| 1 | ################################################################################ |
1 | ################################################################################ |
| 2 | # WeBWorK Online Homework Delivery System |
2 | # WeBWorK Online Homework Delivery System |
| 3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
3 | # Copyright © 2000-2003 The WeBWorK Project, http://openwebwork.sf.net/ |
| 4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/Utils.pm,v 1.61 2005/05/11 14:32:58 gage Exp $ |
4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/Utils.pm,v 1.62 2005/05/19 16:17:44 gage Exp $ |
| 5 | # |
5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify it under |
6 | # This program is free software; you can redistribute it and/or modify it under |
| 7 | # the terms of either: (a) the GNU General Public License as published by the |
7 | # the terms of either: (a) the GNU General Public License as published by the |
| 8 | # Free Software Foundation; either version 2, or (at your option) any later |
8 | # Free Software Foundation; either version 2, or (at your option) any later |
| 9 | # version, or (b) the "Artistic License" which comes with this package. |
9 | # version, or (b) the "Artistic License" which comes with this package. |
| … | |
… | |
| 574 | # $function - fully qualified function name |
574 | # $function - fully qualified function name |
| 575 | # $details - any information, do not use the characters '[' or ']' |
575 | # $details - any information, do not use the characters '[' or ']' |
| 576 | # $beginEnd - the string "begin", "intermediate", or "end" |
576 | # $beginEnd - the string "begin", "intermediate", or "end" |
| 577 | # use the intermediate step begun or completed for INTERMEDIATE |
577 | # use the intermediate step begun or completed for INTERMEDIATE |
| 578 | # use an empty string for $details when calling for END |
578 | # use an empty string for $details when calling for END |
|
|
579 | # Information printed in format: |
|
|
580 | # [formatted date & time ] processID unixTime BeginEnd $function $details |
| 579 | sub writeTimingLogEntry($$$$) { |
581 | sub writeTimingLogEntry($$$$) { |
| 580 | my ($ce, $function, $details, $beginEnd) = @_; |
582 | my ($ce, $function, $details, $beginEnd) = @_; |
| 581 | return unless defined $ce->{webworkFiles}->{logs}->{timing}; |
583 | return unless defined $ce->{webworkFiles}->{logs}->{timing}; |
| 582 | $beginEnd = ($beginEnd eq "begin") ? ">" : ($beginEnd eq "end") ? "<" : "-"; |
584 | $beginEnd = ($beginEnd eq "begin") ? ">" : ($beginEnd eq "end") ? "<" : "-"; |
| 583 | writeLog($ce, "timing", "$$ ".time." $beginEnd $function [$details]"); |
585 | writeLog($ce, "timing", "$$ ".time." $beginEnd $function [$details]"); |