Go to the documentation of this file.
22 #ifndef GAUDIKERNEL_TIMING_H
23 #define GAUDIKERNEL_TIMING_H
32 # include <sys/time.h>
137 template <TimeType T>
167 template <TimeType T>
173 template <TimeType T>
175 return adjustTime<T>(
i_user );
179 template <TimeType T>
185 template <TimeType T>
219 return (
t == -1 ) ?
t :
t /= ( 1LL * 365 * 24 * 60 * 60 * 1000 * 1000 * 10 );
223 return (
t == -1 ) ?
t :
t /= ( 1LL * 24 * 60 * 60 * 1000 * 1000 * 10 );
227 return (
t == -1 ) ?
t :
t /= ( 1LL * 60 * 60 * 1000 * 1000 * 10 );
231 return (
t == -1 ) ?
t :
t /= ( 60 * 1000 * 1000 * 10 );
235 return (
t == -1 ) ?
t :
t /= ( 1000 * 1000 * 10 );
239 return (
t == -1 ) ?
t :
t /= ( 1000 * 10 );
243 return (
t == -1 ) ?
t :
t /= ( 10LL );
247 return (
t == -1 ) ?
t :
t *= 100LL;
251 return (
t == -1 ) ?
t :
t /= ( 1LL * 30 * 24 * 60 * 60 * 1000 * 1000 * 10 );
259 template <TimeType T>
262 long long current = 0;
263 ::GetSystemTimeAsFileTime( (FILETIME*)¤t );
264 return adjustTime<T>( current - UNIX_BASE_TIME );
267 ::gettimeofday( &tv, 0 );
268 return adjustTime<T>( ( tv.tv_sec * 1000000 + tv.tv_usec ) * 10 );
285 #endif // GAUDIKERNEL_TIMING_H
template long long currentTime< Month >()
InfoType
Enumeration for fetching information.
ProcessTime()
Constructor.
long long adjustTime< Month >(long long t)
GAUDI_API long long remainingTime(TimeType typ=milliSec, InfoType fetch=Quota, long pid=-1)
Maximum processing time left for this process.
TimeValueType kernelTime() const
Retrieve the kernel time in the requested unit.
template long long currentTime< Hour >()
ProcessTime(TimeValueType k, TimeValueType u, TimeValueType e)
Constructor.
TimeType
Time type for conversion.
GAUDI_API long long kernelTime(TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
CPU kernel mode time of process in milliseconds.
template long long currentTime< Year >()
GAUDI_API long long ellapsedTime(TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
Elapsed time since start of process in milliseconds.
long long adjustTime< milliSec >(long long t)
TimeValueType elapsedTime() const
Retrieve the elapsed time in the requested unit.
long long adjustTime< Day >(long long t)
long long adjustTime< Year >(long long t)
long long adjustTime< Native >(long long t)
template long long currentTime< milliSec >()
Simple class to hold the time information of a process.
GAUDI_API long long tickCount()
Retrieve the number of ticks since system startup.
GAUDI_API long long currentTime()
Retrieve absolute system time.
long long adjustTime< nanoSec >(long long t)
TimeValueType i_kernel
Internal storage.
ProcessTime operator-(const ProcessTime &rhs) const
Return the delta between two ProcessTime objects.
long long adjustTime< microSec >(long long t)
GAUDI_API long long upTime(TimeType typ=Hour)
Maximum processing time left for this process.
GAUDI_API long long cpuTime(TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
Consumed CPU time of process in milliseconds.
GAUDI_API long long userTime(TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
CPU user mode time of process in milliseconds.
template long long currentTime< microSec >()
template long long currentTime< Min >()
long long adjustTime< Min >(long long t)
long long adjustTime< Hour >(long long t)
template long long currentTime< Sec >()
long long adjustTime< Sec >(long long t)
template long long currentTime< Native >()
template long long currentTime< Day >()
GAUDI_API long long adjustTime(TimeType typ, long long timevalue)
Convert time from OS native time to requested representation (Experts only)
Note: OS specific details for environment resolution.
TimeValueType userTime() const
Retrieve the user time in the requested unit.
TimeValueType cpuTime() const
Retrieve the CPU (user+kernel) time in the requested unit.
GAUDI_API ProcessTime getProcessTime(long pid=-1)
Retrieve the process time data for a process.
GAUDI_API long long systemStart(TimeType typ=Sec)
Maximum processing time left for this process.
ProcessTime & operator+=(const ProcessTime &rhs)
Add the timings to the current objects.
template long long currentTime< nanoSec >()
GAUDI_API long long creationTime(TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
Process Creation time.