The Chrono class extends the umontreal.ssj.util.AbstractChrono class and computes the CPU time for the current thread only. More...
Public Member Functions | |
| Chrono () | |
| Constructs a Chrono object and initializes it to zero. | |
| void | init () |
| Initializes this AbstractChrono to zero. | |
| double | getSeconds () |
| Returns the CPU time in seconds used by the program since the last call to init for this AbstractChrono. | |
| double | getMinutes () |
| Returns the CPU time in minutes used by the program since the last call to init for this AbstractChrono. | |
| double | getHours () |
| Returns the CPU time in hours used by the program since the last call to init for this AbstractChrono. | |
| String | format () |
| Converts the CPU time used by the program since its last call to init for this AbstractChrono to a String in the HH:MM:SS.xx format. | |
Static Public Member Functions | |
| static Chrono | createForSingleThread () |
| Creates a Chrono instance adapted for a program using a single thread. | |
| static String | format (double time) |
| Converts the time time, given in seconds, to a String in the HH:MM:SS.xx format. | |
The Chrono class extends the umontreal.ssj.util.AbstractChrono class and computes the CPU time for the current thread only.
It is equivalent to
ChronoSingleThread. The class umontreal.ssj.util.ChronoWall provides another option.
Definition at line 37 of file Chrono.java.
| umontreal.ssj.util.Chrono.Chrono | ( | ) |
Constructs a Chrono object and initializes it to zero.
Definition at line 47 of file Chrono.java.
|
static |
Creates a Chrono instance adapted for a program using a single thread.
It is equivalent to ChronoSingleThread. This class should not be used to create a timer for a multi-threaded program, because the obtained CPU times will differ depending on the used Java version.
Definition at line 60 of file Chrono.java.