de.unihalle.informatik.MiToBo.tools.system
Class UserTime

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.tools.system.UserTime

@ALDMetaInfo(export=ALLOWED)
public class UserTime
extends Object

This is a stopwatch to measure elapsed user or real time used.

If the proper native library is availabe and is requested user time is elapsed. Otherwith real time is elapsed. If you like to use this class you must set the VM option -Djava.library.path to the directory where the native library resides.
The native library is

Author:
Jens Keilwagen, modified: Stefan Posch

Constructor Summary
UserTime()
          Creates a new time object and starts the clock.
UserTime(boolean useUsertime)
          Creates a new time object and starts the clock elapsing real time.
 
Method Summary
 double getElapsedTime()
          Returns the elapsed time since last reset (or invoking the constructor) in seconds
 String getOperation()
          Return UserTime or RealTime depending on mode of operation
 void reset()
          Reset time
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserTime

public UserTime()
Creates a new time object and starts the clock. Elapses user time, if runtime library is available, otherwise the real time.


UserTime

public UserTime(boolean useUsertime)
Creates a new time object and starts the clock elapsing real time. Elapses user time, if useUsertime is true and the runtime library is available, otherwise the real time.

Method Detail

getElapsedTime

public double getElapsedTime()
Returns the elapsed time since last reset (or invoking the constructor) in seconds


reset

public void reset()
Reset time


getOperation

public String getOperation()
Return UserTime or RealTime depending on mode of operation



Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.