WeBWorK::Timing - Log timing data.
head1 SYNOPSIS
use WeBWorK::Timing;
# Enable timing
$WeBWorK::Timing::Enable = 1;
# Log to a file instead of STDERR
$WeBWorK::Timing::Logfile = "/path/to/timing.log";
my $timer = WeBWorK::Timing->new("do some processesing");
$timer->start;
do_some_processing();
$timer->continue("
do_some_more_processing();
$timer->stop;
$timer->save;
my $timer0 = WeBWorK::Timing->new("main task");
my $timer1 = WeBWorK::Timing->new("subtask 1");
my $timer2 = WeBWorK::Timing->new("subtask 1");
$timer0->start;
$timer1->start;
sub_task(1);
$timer1->stop;
$timer2->start;
sub_task(2);
$timer2->stop;
$timer0->stop;
# timing data is saved when objects go out of scope
If true, timing messages will be output. If false, they will be ignored.
If non-empty, timing output will be sent to the file named rather than STDERR.
new($task)
new creates a new timing object, with the task given in $task.
begin()
Marks the current time as the start time for the task.
continue($data)
Stores the current time as an intermediate time, associated with the string given in $data.
end()
Marks the current time as the stop time for the task.
save()
Writes the timing data for this task to the standard error stream. If save is not called explicitly, it is called when the object goes out of scope.
Written by Sam Hathaway, sh002i (at) math.rochester.edu.
The timing utility can be used to parse and sort log output.