Members
(static) accs
Timing accumulators.
(static) messages :Array.<string>
Timing messages - how long did each timer take?
Type:
(static) timers :Array.<Date>
A queue of timers.
Type:
Methods
(static) displayDate() → {string}
Get the current date as a string in the user's locale.
Returns:
Type | Description |
---|---|
string |
(static) end(label)
End the top timer on the queue.
Parameters:
Name | Type | Description |
---|---|---|
label |
string | A description of the timer. |
(static) endacc(name)
Stop accumulating runtime for a function.
Parameters:
Name | Type | Description |
---|---|---|
name |
string |
(static) secsToDisplayTime(time) → {string}
Convert a number of seconds to a string in HH:MM:SS
format.
Parameters:
Name | Type | Description |
---|---|---|
time |
number |
Returns:
Type | Description |
---|---|
string |
(static) show()
Show all timing messages through Numbas.debug
.
(static) start()
Start a new timer.
- Source:
- See:
(static) startacc(name)
Accumulators are for counting time spent in functions which don't take long to evaluate, but are called repeatedly.
Call this with the function's name when you start the function, and Numbas.timing.endacc
with the same name just before returning a value.
It copes with recursion automatically, so you don't need to worry about double counting.
Parameters:
Name | Type | Description |
---|---|---|
name |
string |