Class Chrono

java.lang.Object
fr.formiko.usuel.Chrono

public class Chrono extends Object
Time counter
cf https://fr.jeffprod.com/blog/2015/un-chronometre-en-java/
Author:
Hydrolien, JeffProd
  • Field Details

    • tempsDepart

      private long tempsDepart
    • tempsFin

      private long tempsFin
    • pauseDepart

      private long pauseDepart
    • pauseFin

      private long pauseFin
    • duree

      private long duree
    • id

      private final int id
    • idCpt

      private static int idCpt
    • ch

      private static Chrono ch
  • Constructor Details

    • Chrono

      public Chrono()
  • Method Details

    • getId

      public int getId()
    • getDuree

      public long getDuree()
    • getDureeSec

      public long getDureeSec()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Standard equals function. Null & other class type proof.
      Overrides:
      equals in class Object
      Parameters:
      o - o is the Object to test. It can be null or something else than this class.
    • start

      public void start()
    • pause

      public void pause()
    • resume

      public void resume()
    • stop

      public void stop()
    • updateDuree

      public void updateDuree()
      update duree to be able to read it.
    • timeToHMS

      public static String timeToHMS(long tempsS)
    • iniCh

      public static void iniCh()
      Initializes Chrono ch.
    • debutCh

      public static void debutCh()
    • endCh

      public static int endCh(String s)
    • debutCh

      public static void debutCh(Chrono chTemp)
    • startCh

      public static void startCh(Chrono chTemp)
      Start Chrono
    • endCh

      public static int endCh(String s, Chrono chTemp)
      Stop Chrono and print a message about Chrono duration.
      The message will be print in console only if debug.setPerformance is true.
      Message will be print only if the do more than 20ms.
      Returns:
      duration time.