Skip to content

Custom Timer

cakoyo edited this page May 14, 2019 · 1 revision

This class contains a timer you can set. This timer only for calc the time, if you want do tasks, you should check Schedulers

Timer use nanoTime for timeunit.

setTimer

Create a timer and return a UniqueTimerID.

UUID timerID = CustomTimer.setTimer();

getTimer

Get a timer already running how long time. It won't stop and destory timer, if you want get the time and destory time, you should see endTimer

long alreadyRunning = CustomTimer.getTimer(timerID);

endTimer

Get a time already running how long time and stop and destory the timer.

long alreadyRunning = CustonTimer.endTimer(timerID);

Clone this wiki locally