|
|
@@ -22,7 +22,7 @@ import net.ranides.assira.collection.maps.IdentMap;
|
|
|
*
|
|
|
* @author Ranides Atterwim {@literal <ranides@gmail.com>}
|
|
|
*/
|
|
|
-public final class TimeMetric {
|
|
|
+public final class TimeMeter {
|
|
|
|
|
|
private static final Map<TimeUnit, String> UNITS = new IdentMap<>(
|
|
|
new TimeUnit[]{TimeUnit.DAYS, TimeUnit.HOURS, TimeUnit.MICROSECONDS, TimeUnit.MILLISECONDS, TimeUnit.MINUTES, TimeUnit.NANOSECONDS, TimeUnit.SECONDS},
|
|
|
@@ -39,7 +39,7 @@ public final class TimeMetric {
|
|
|
* Creates new inactive stopwatch.
|
|
|
* Returned results are expressed in milliseconds by default.
|
|
|
*/
|
|
|
- public TimeMetric() {
|
|
|
+ public TimeMeter() {
|
|
|
this(false);
|
|
|
}
|
|
|
|
|
|
@@ -52,7 +52,7 @@ public final class TimeMetric {
|
|
|
*
|
|
|
* @param unit unit
|
|
|
*/
|
|
|
- public TimeMetric(TimeUnit unit) {
|
|
|
+ public TimeMeter(TimeUnit unit) {
|
|
|
this(false, unit);
|
|
|
}
|
|
|
|
|
|
@@ -60,7 +60,7 @@ public final class TimeMetric {
|
|
|
* Creates new inactive stopwatch.
|
|
|
* Returned results are expressed in milliseconds by default.
|
|
|
*/
|
|
|
- public TimeMetric(boolean threadsafe) {
|
|
|
+ public TimeMeter(boolean threadsafe) {
|
|
|
this(threadsafe, TimeUnit.MILLISECONDS);
|
|
|
}
|
|
|
|
|
|
@@ -73,7 +73,7 @@ public final class TimeMetric {
|
|
|
*
|
|
|
* @param unit unit
|
|
|
*/
|
|
|
- public TimeMetric(boolean threadsafe, TimeUnit unit) {
|
|
|
+ public TimeMeter(boolean threadsafe, TimeUnit unit) {
|
|
|
this.unit = unit;
|
|
|
this.threadsafe = threadsafe;
|
|
|
start();
|
|
|
@@ -85,7 +85,7 @@ public final class TimeMetric {
|
|
|
*
|
|
|
* @return this
|
|
|
*/
|
|
|
- public TimeMetric start() {
|
|
|
+ public TimeMeter start() {
|
|
|
return $synchronized(() -> {
|
|
|
stack.push(System.nanoTime());
|
|
|
return this;
|