grandma
grandma copied to clipboard
support for timestamps and relative timers
Currently, you have to start and end a timer with the same name. This is a problem if you want to time several events from the start of the test (or from some milestone), but you do not know necessarily know how many events you will be timing or what their names will be. I would like an API that can create a timestamp (or milestone) and be able to record named timer values from that milestone rather than from the start of a timer with the same name.
Example:
this.timestamp('milestone name');
...
this.end('timer name', 'milestone name');
Note: it might need to use a specific new function name for this method, so as to not need to execute extra logic to determine whether it is ending a named timer or if it is relative to a timestamp... since timers can be very sensitive.
It might be better to implement this directly in hitime.