ENDRPrint/.svn/pristine/9a/9a1d2d5b287ce48e5bd176d5c8eab9a39eaf2236.svn-base
2024-08-14 10:33:27 +07:00

28 lines
580 B
Plaintext

package th.co.muangthai.endrprint.util;
/**
* Created by Matthaus on 9/29/15.
*/
public class Stopwatch {
private final long start;
/**
* Initializes a new stopwatch.
*/
public Stopwatch() {
start = System.currentTimeMillis();
}
/**
* Returns the elapsed CPU time (in seconds) since the stopwatch was created.
*
* @return elapsed CPU time (in seconds) since the stopwatch was created
*/
public double elapsedTime() {
long now = System.currentTimeMillis();
return (now - start) / 1000.0;
}
}