12 #ifndef GAUDIKERNEL_TIMING_H 13 #define GAUDIKERNEL_TIMING_H 22 # include <sys/time.h> 64 inline long long adjustTime(
long long timevalue );
127 template <TimeType T>
157 template <TimeType T>
163 template <TimeType T>
165 return adjustTime<T>(
i_user );
169 template <TimeType T>
175 template <TimeType T>
209 return ( t == -1 ) ? t : t /= ( 1LL * 365 * 24 * 60 * 60 * 1000 * 1000 * 10 );
213 return ( t == -1 ) ? t : t /= ( 1LL * 24 * 60 * 60 * 1000 * 1000 * 10 );
217 return ( t == -1 ) ? t : t /= ( 1LL * 60 * 60 * 1000 * 1000 * 10 );
221 return ( t == -1 ) ? t : t /= ( 60 * 1000 * 1000 * 10 );
225 return ( t == -1 ) ? t : t /= ( 1000 * 1000 * 10 );
229 return ( t == -1 ) ? t : t /= ( 1000 * 10 );
233 return ( t == -1 ) ? t : t /= ( 10LL );
237 return ( t == -1 ) ? t : t *= 100LL;
241 return ( t == -1 ) ? t : t /= ( 1LL * 30 * 24 * 60 * 60 * 1000 * 1000 * 10 );
249 template <TimeType T>
252 long long current = 0;
253 ::GetSystemTimeAsFileTime( (FILETIME*)¤t );
254 return adjustTime<T>( current - UNIX_BASE_TIME );
257 ::gettimeofday( &tv, 0 );
258 return adjustTime<T>( ( tv.tv_sec * 1000000 + tv.tv_usec ) * 10 );
275 #endif // GAUDIKERNEL_TIMING_H GAUDI_API long long creationTime(TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
Process Creation time.
ProcessTime(TimeValueType k, TimeValueType u, TimeValueType e)
Constructor.
template long long currentTime< Month >()
TimeValueType kernelTime() const
Retrieve the kernel time in the requested unit.
Note: OS specific details for environment resolution.
template long long currentTime< Year >()
TimeValueType userTime() const
Retrieve the user time in the requested unit.
ProcessTime operator-(const ProcessTime &rhs) const
Return the delta between two ProcessTime objects.
long long adjustTime< Native >(long long t)
ProcessTime()
Constructor.
long long adjustTime< Month >(long long t)
template long long currentTime< Hour >()
GAUDI_API long long remainingTime(TimeType typ=milliSec, InfoType fetch=Quota, long pid=-1)
Maximum processing time left for this process.
TimeValueType i_kernel
Internal storage.
long long adjustTime< nanoSec >(long long t)
GAUDI_API long long currentTime()
Retrieve absolute system time.
long long adjustTime< Day >(long long t)
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.
GAUDI_API long long userTime(TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
CPU user mode time of process in milliseconds.
long long adjustTime< milliSec >(long long t)
long long adjustTime< Year >(long long t)
Simple class to hold the time information of a process.
long long adjustTime< microSec >(long long t)
GAUDI_API long long ellapsedTime(TimeType typ=milliSec, InfoType fetch=Times, long pid=-1)
Elapsed time since start of process in milliseconds.
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 tickCount()
Retrieve the number of ticks since system startup.
GAUDI_API long long upTime(TimeType typ=Hour)
Maximum processing time left for this process.
long long adjustTime< Min >(long long t)
template long long currentTime< Sec >()
template long long currentTime< Min >()
template long long currentTime< Native >()
template long long currentTime< milliSec >()
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)
TimeValueType elapsedTime() const
Retrieve the elapsed time in the requested unit.
GAUDI_API ProcessTime getProcessTime(long pid=-1)
Retrieve the process time data for a process.
long long adjustTime< Hour >(long long t)
TimeValueType cpuTime() const
Retrieve the CPU (user+kernel) time in the requested unit.
template long long currentTime< nanoSec >()
ProcessTime & operator+=(const ProcessTime &rhs)
Add the timings to the current objects.
long long adjustTime< Sec >(long long t)
template long long currentTime< microSec >()
GAUDI_API long long systemStart(TimeType typ=Sec)
Maximum processing time left for this process.
InfoType
Enumeration for fetching information.