in hugegraph-common/src/main/java/org/apache/hugegraph/perf/NormalStopwatch.java [101:124]
public void endTime(long startTime) {
assert startTime >= this.lastStartTime && this.lastStartTime != -1L :
MULTI_THREAD_ACCESS_ERROR;
long endTime = PerfUtil.now();
// The following code cost about 3ns~4ns
long wastedTime = endTime - startTime;
if (wastedTime <= 0L) {
wastedTime += eachEndWastedLost;
}
long cost = endTime - this.lastStartTime;
if (this.minCost > cost) {
this.minCost = cost;
}
if (this.maxCost < cost) {
this.maxCost = cost;
}
this.totalCost += cost;
this.totalSelfWasted += wastedTime;
this.lastStartTime = -1L;
}