Timer.java provides a simple 'stopwatch' timer for timing execution.
Default constructorPostcondition: the timer is not running.
Start the timer.Postcondition: the timer is running and the system time has been remembered as the starting time.
Stop the timer.Postcondition: the timer is not running and the system time has been remembered as the stopping time.
Reset the timer.Postcondition: the system time has been remembered as the starting time.
Get the time from the timer in seconds.Return: if the timer is running compute the difference between the current system time and the starting time, otherwise, compute the difference between the stopping time and the starting time
String converter (output)Return: the String equivalent to my time in seconds.
Back to the package documentation index