GeoSoft API

no.geosoft.cc.util
Class Timer

Object
  |
  +--Timer

public class Timer
extends Object

Class for program event timing. Usage:

   Timer timer = new Timer();

   // do stuff

   System.out.println (timer);  // prints time elapsed since
                                // object was created.
   

Author:
GeoSoft

Constructor Summary
Timer()
          Start timer.
 
Method Summary
 long getTime()
          Returns exact number of milliseconds since timer was started.
static void main(String[] args)
          Testing this class.
 void reset()
          Restarts the timer.
 String toString()
          Returns a formatted string showing the elaspsed time suince the instance was created.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Timer

public Timer()
Start timer.

Method Detail

getTime

public long getTime()
Returns exact number of milliseconds since timer was started.

Returns:
Number of milliseconds since timer was started.

reset

public void reset()
Restarts the timer.


toString

public String toString()
Returns a formatted string showing the elaspsed time suince the instance was created.

Overrides:
toString in class Object
Returns:
Formatted time string.

main

public static void main(String[] args)
Testing this class.

Parameters:
args - Not used.

GeoSoft API

Copyright © 2004 - Geotechnical Software Services     geosoft.no