Class Timer


  • public class Timer
    extends Object
    A class to measure a time span. The resolution will be in ms.
    Author:
    18.12.2009 simon.pertschy@ntb.ch
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) boolean active  
      (package private) int time  
      (package private) int timerTime  
    • Constructor Summary

      Constructors 
      Constructor Description
      Timer()  
    • Field Detail

      • time

        int time
      • timerTime

        int timerTime
      • active

        boolean active
    • Constructor Detail

      • Timer

        public Timer()
    • Method Detail

      • set

        public void set​(int ms)
        Set the time to measure.
        Parameters:
        ms - the time in milliseconds
      • reset

        public void reset()
        Reset the timer. This call only works if the timer has not been expired.
      • stop

        public void stop()
        Stop the timer.
      • expired

        public boolean expired()
        Returns true if the time is expired. false otherwise.
        Returns:
        true if the time is expired.