MCPcopy Create free account
hub / github.com/InterviewReady/Low-Level-Design / Timer

Class Timer

rate-limiter/src/main/java/utils/Timer.java:5–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import java.util.concurrent.TimeUnit;
4
5public class Timer {
6 public long getCurrentTime(final TimeUnit timeUnit) {
7 return timeUnit.convert(getCurrentTimeInMillis(), TimeUnit.MILLISECONDS);
8 }
9
10 public long getCurrentTimeInMillis() {
11 return System.currentTimeMillis();
12 }
13}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected