Extends the AbstractChrono class to compute the CPU time for a single thread. More...
Public Member Functions | |
| ChronoSingleThread () | |
| Constructs a ChronoSingleThread object associated with current thread and initializes it to zero. | |
| ChronoSingleThread (Thread inThread) | |
| Constructs a ChronoSingleThread object associated with the given Thread variable 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. | |
Additional Inherited Members | |
| static String | format (double time) |
| Converts the time time, given in seconds, to a String in the HH:MM:SS.xx format. | |
Extends the AbstractChrono class to compute the CPU time for a single thread.
This uses the getThreadCpuTime function from a ThreadMXBean object, from java.lang.management.ManagementFactory. If the associated thread is dead, the returned time will be 0.
Definition at line 38 of file ChronoSingleThread.java.
| umontreal.ssj.util.ChronoSingleThread.ChronoSingleThread | ( | ) |
Constructs a ChronoSingleThread object associated with current thread and initializes it to zero.
Definition at line 72 of file ChronoSingleThread.java.
| umontreal.ssj.util.ChronoSingleThread.ChronoSingleThread | ( | Thread | inThread | ) |
Constructs a ChronoSingleThread object associated with the given Thread variable and initializes it to zero.
Definition at line 82 of file ChronoSingleThread.java.