1 package org.simantics.db.procore.cluster;
\r
3 //Simple class for measuring time.
\r
4 public class Stopwatch
\r
6 public final void start() { // Starts measuring time.
\r
7 start = System.nanoTime();
\r
9 public final void stop() { // Ends measuring time, increases the amount of elapsed time.
\r
10 time += (double)(System.nanoTime() - start) * (double)(1e-9);
\r
12 public final void reset() { // Set elapsed time to zero.
\r
15 public final void restart() { // Reset and starts measuring time.
\r
19 public final double elapsed() { // Returns elapsed time in seconds.
\r
22 public final double elapsedMilli() { // Returns elapsed time in milliseconds.
\r
26 private double time;
\r