Skip to content

Commit f2c5a2b

Browse files
In CPUTimer make the update method public (#7809)
1 parent 89bcd41 commit f2c5a2b

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

api/src/org/labkey/api/util/CPUTimer.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,18 @@ public boolean stopWithoutSave()
109109
public boolean save()
110110
{
111111
if (_stop > _start)
112-
_update(_stop - _start);
112+
update(_stop - _start);
113113
_start = 0;
114114
_stop = 0;
115115
return true;
116116
}
117117

118-
protected void _update(long elapsed)
118+
/**
119+
* Manually set the elapsed time for a timer. Could be used to set the timer to a predefined "max-high" value.
120+
*
121+
* @param elapsed time in nanoseconds.
122+
*/
123+
public void update(long elapsed)
119124
{
120125
_cumulative += elapsed;
121126
_min = Math.min(_min, elapsed);
@@ -134,7 +139,7 @@ public boolean saveTo(CPUTimer accumulator)
134139
{
135140
synchronized (accumulator)
136141
{
137-
accumulator._update(_stop-_start);
142+
accumulator.update(_stop-_start);
138143
}
139144
}
140145
_start = 0;

0 commit comments

Comments
 (0)