umontreal.iro.lecuyer.util
Class ChronoSingleThread
java.lang.Object
umontreal.iro.lecuyer.util.Chrono
umontreal.iro.lecuyer.util.ChronoSingleThread
public class ChronoSingleThread
- extends Chrono
The ChronoSingleThread
class extends the Chrono
class and computes
the CPU time for the current thread only. It is valid only under Java-1.5
since Java-1.5 provides platform-independent
facilities to get the CPU time for a single thread through management API.
The parent class Chrono
uses a platform-dependent method
(since it is programmed
directly in C) to determine the CPU time for all threads.
Here is an example of how it may be used:
Chrono timer = new ChronoSingleThread();
double t = timer.getSeconds();
timer.init();
t = timer.getSeconds();
t = timer.getMinutes();
System.out.println (timer.format());
Constructor Summary |
ChronoSingleThread()
Constructs a ChronoSingleThread object and
initializes it to zero. |
ChronoSingleThread
public ChronoSingleThread()
- Constructs a ChronoSingleThread object and
initializes it to zero.
To submit a bug or ask questions, send an e-mail to
Pierre L'Ecuyer.