| … | |
… | |
| 85 | } |
85 | } |
| 86 | |
86 | |
| 87 | # $ce - a WeBWork::CourseEnvironment object |
87 | # $ce - a WeBWork::CourseEnvironment object |
| 88 | # $function - fully qualified function name |
88 | # $function - fully qualified function name |
| 89 | # $details - any information, do not use the characters '[' or ']' |
89 | # $details - any information, do not use the characters '[' or ']' |
| 90 | # $beginEnd - the string "begin" or "end" |
90 | # $beginEnd - the string "begin", "intermediate", or "end" |
|
|
91 | # use the intermediate step begun or completed for INTERMEDIATE |
| 91 | # use an empty string for $details when calling for END |
92 | # use an empty string for $details when calling for END |
| 92 | sub writeTimingLogEntry($$$$) { |
93 | sub writeTimingLogEntry($$$$) { |
| 93 | my ($ce, $function, $details, $beginEnd) = @_; |
94 | my ($ce, $function, $details, $beginEnd) = @_; |
| 94 | return unless defined $ce->{webworkFiles}->{logs}->{timing}; |
95 | return unless defined $ce->{webworkFiles}->{logs}->{timing}; |
| 95 | $beginEnd = ($beginEnd eq "begin") ? ">" : "<"; |
96 | $beginEnd = ($beginEnd eq "begin") ? ">" : ($beginEnd eq "end") ? "<" : "-"; |
| 96 | writeLog($ce, "timing", "$$ ".time." $beginEnd $function [$details]"); |
97 | writeLog($ce, "timing", "$$ ".time." $beginEnd $function [$details]"); |
| 97 | } |
98 | } |
| 98 | |
99 | |
| 99 | # ----- |
100 | # ----- |
| 100 | |
101 | |