Package fr.formiko.usuel
Class Chrono
java.lang.Object
fr.formiko.usuel.Chrono
Time counter
cf https://fr.jeffprod.com/blog/2015/un-chronometre-en-java/
cf https://fr.jeffprod.com/blog/2015/un-chronometre-en-java/
- Author:
- Hydrolien, JeffProd
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Chrono
private long
private int
private static int
private long
private long
private long
private long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
debutCh()
static void
static int
static int
Stop Chrono and print a message about Chrono duration.boolean
Standard equals function.long
getDuree()
long
int
getId()
static void
iniCh()
Initializes Chrono ch.void
pause()
void
resume()
void
start()
static void
Start Chronovoid
stop()
static String
timeToHMS(long tempsS)
toString()
void
update duree to be able to read it.
-
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
-
-
Constructor Details
-
Chrono
public Chrono()
-
-
Method Details
-
getId
public int getId() -
getDuree
public long getDuree() -
getDureeSec
public long getDureeSec() -
toString
-
equals
Standard equals function. Null & other class type proof. -
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
-
iniCh
public static void iniCh()Initializes Chrono ch. -
debutCh
public static void debutCh() -
endCh
-
debutCh
-
startCh
Start Chrono -
endCh
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.
-