SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.util.Chrono Class Reference

The Chrono class extends the umontreal.ssj.util.AbstractChrono class and computes the CPU time for the current thread only. More...

Inheritance diagram for umontreal.ssj.util.Chrono:
umontreal.ssj.util.AbstractChrono

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ Chrono()

umontreal.ssj.util.Chrono.Chrono ( )

Constructs a Chrono object and initializes it to zero.

Definition at line 47 of file Chrono.java.

Member Function Documentation

◆ createForSingleThread()

Chrono umontreal.ssj.util.Chrono.createForSingleThread ( )
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.

Returns
the constructed timer.

Definition at line 60 of file Chrono.java.


The documentation for this class was generated from the following file: