Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions api/src/org/labkey/api/util/CPUTimer.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,18 @@ public boolean stopWithoutSave()
public boolean save()
{
if (_stop > _start)
_update(_stop - _start);
update(_stop - _start);
_start = 0;
_stop = 0;
return true;
}

protected void _update(long elapsed)
/**
* Manually set the elapsed time for a timer. Could be used to set the timer to a predefined "max-high" value.
*
* @param elapsed time in nanoseconds.
*/
public void update(long elapsed)
{
_cumulative += elapsed;
_min = Math.min(_min, elapsed);
Expand All @@ -134,7 +139,7 @@ public boolean saveTo(CPUTimer accumulator)
{
synchronized (accumulator)
{
accumulator._update(_stop-_start);
accumulator.update(_stop-_start);
}
}
_start = 0;
Expand Down