ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/State.pm
(Generate patch)

Comparing Coro/Coro/State.pm (file contents):
Revision 1.143 by root, Tue Jun 23 23:40:06 2009 UTC vs.
Revision 1.144 by root, Mon Jun 29 06:14:23 2009 UTC

334default being C<4>. 334default being C<4>.
335 335
336=item @states = Coro::State::list 336=item @states = Coro::State::list
337 337
338Returns a list of all states currently allocated. 338Returns a list of all states currently allocated.
339
340=item $was_enabled = Coro::State::enable_times [$enable]
341
342Enables/disables/queries the current state of per-thread real and
343cpu-time gathering.
344
345When enabled, the real time and the cpu time (user + system time)
346spent in each thread is accumulated. If disabled, then the accumulated
347times will stay as they are (they start at 0).
348
349Currently, cpu time is only measured on GNU/Linux systems, all other
350systems only gather real time.
351
352Enabling time profiling slows down thread switching by a factor of 2 to
35310, depending on platform on hardware.
354
355The times will be displayed when running C<Coro::Debug::command "ps">, and
356cna be queried by calling C<< $state->times >>.
357
358=item ($real, $cpu) = $state->times
359
360Returns the real time and cpu times spent in the given C<$state>. See
361C<Coro::State::enable_times> for more info.
339 362
340=item $clone = $state->clone 363=item $clone = $state->clone
341 364
342This exciting method takes a Coro::State object and clones it, i.e., it 365This exciting method takes a Coro::State object and clones it, i.e., it
343creates a copy. This makes it possible to restore a state more than once, 366creates a copy. This makes it possible to restore a state more than once,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines