SSJ  3.3.1
Stochastic Simulation in Java
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
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 Chrono:
[legend]
Collaboration diagram for Chrono:
[legend]

Public Member Functions

 Chrono ()
 Constructs a Chrono object and initializes it to zero.
 
- Public Member Functions inherited from AbstractChrono
 AbstractChrono ()
 
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. More...
 
double getMinutes ()
 Returns the CPU time in minutes used by the program since the last call to init for this AbstractChrono. More...
 
double getHours ()
 Returns the CPU time in hours used by the program since the last call to init for this AbstractChrono. More...
 
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. More...
 

Static Public Member Functions

static Chrono createForSingleThread ()
 Creates a Chrono instance adapted for a program using a single thread. More...
 
- Static Public Member Functions inherited from AbstractChrono
static String format (double time)
 Converts the time time, given in seconds, to a String in the HH:MM:SS.xx format. More...
 

Protected Member Functions

void getTime (long[] tab)
 
- Protected Member Functions inherited from AbstractChrono
abstract void getTime (long[] tab)
 

Detailed Description

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

This is the simplest way to use chronos. Classes AbstractChrono, umontreal.ssj.util.SystemTimeChrono, umontreal.ssj.util.GlobalCPUTimeChrono and umontreal.ssj.util.ThreadCPUTimeChrono provide different chronos implementations. See these classes to learn more about SSJ chronos, if problems appear with class Chrono.

Member Function Documentation

◆ createForSingleThread()

static Chrono createForSingleThread ( )
static

Creates a Chrono instance adapted for a program using a single thread.

Under Java 1.5, this method returns an instance of ChronoSingleThread which can measure CPU time for one thread. Under Java versions prior to 1.5, this returns an instance of this class. This method must 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.

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