TEMU
2
The Terma Emulator
|
Go to the source code of this file.
Functions | |
TEMU_API uint64_t | temu_timeGetMonotonicWct (void) |
TEMU_API uint64_t | temu_timeGetThreadWct (void) |
temu_timeGetThreadWct Returns wall clock nanoseconds of thread time (i.e. how much time the thread this is called from has been scheduled) More... | |
TEMU_API uint64_t | temu_timeGetCurrentSrtNanos (void *Obj) |
temu_timeGetCurrentSrtNanos More... | |
TEMU_API int64_t | temu_getCycles (const void *Q) |
TEMU_API int64_t | temu_getNanos (const void *Q) |
TEMU_API double | temu_getSecs (const void *Q) |
TEMU_API int64_t | temu_cyclesToNanos (int64_t Cycles, int64_t Freq) |
TEMU_API double | temu_cyclesToSecs (int64_t Cycles, int64_t Freq) |
TEMU_API int64_t | temu_nanosToCycles (int64_t Nanos, int64_t Freq) |
TEMU_API double | temu_nanosToSecs (int64_t Nanos) |
TEMU_API int64_t | temu_secsToNanos (double Secs) |
TEMU_API int64_t | temu_secsToCycles (double Secs, int64_t Freq) |
TEMU_API int64_t temu_cyclesToNanos | ( | int64_t | Cycles, |
int64_t | Freq | ||
) |
Convert cycles to nanoseconds
Cycles | Cycle count to convert |
Freq | Frequency in Hz |
TEMU_API double temu_cyclesToSecs | ( | int64_t | Cycles, |
int64_t | Freq | ||
) |
Convert cycles to seconds
Cycles | Cycle count to convert |
Freq | Frequency in Hz |
TEMU_API int64_t temu_getCycles | ( | const void * | Q | ) |
Get current time in cycles.
Q | CPU object |
TEMU_API int64_t temu_getNanos | ( | const void * | Q | ) |
Get current time in nanoseconds
Q | CPU or Machine object |
TEMU_API double temu_getSecs | ( | const void * | Q | ) |
Get current time in seconds
Q | CPU or Machine object |
TEMU_API int64_t temu_nanosToCycles | ( | int64_t | Nanos, |
int64_t | Freq | ||
) |
Convert nanoseconds to cycles
Nanos | Nanoseconds to convert |
Freq | Frequency in Hz |
TEMU_API double temu_nanosToSecs | ( | int64_t | Nanos | ) |
Convert nanoseconds to seconds
Nanos | Nanoseconds to convert |
TEMU_API int64_t temu_secsToCycles | ( | double | Secs, |
int64_t | Freq | ||
) |
Convert seconds to cycles
Secs | Seconds to convert |
Freq | Frequency in Hz |
TEMU_API int64_t temu_secsToNanos | ( | double | Secs | ) |
Convert seconds to nanoseconds
Secs | Seconds to convert |
TEMU_API uint64_t temu_timeGetCurrentSrtNanos | ( | void * | Obj | ) |
temu_timeGetCurrentSrtNanos
Obj | The object in question |
TEMU_API uint64_t temu_timeGetMonotonicWct | ( | void | ) |
Get monotonic time in nanoseconds.
The monotonic time is relative since some epoch of undefined start, but it is monotonic, unaffected by adjustments due to leap seconds, setting of the system clock, etc.
This function is primarily useful for doing performance measurements since the time returned is relative to an undefined point (although that undefined point will be consistent while the program is running).
In practice, on systems with clock_gettime() implemented, this function returns the timespec converted to nanoseconds, but on systems without clock_gettime(), e.g. Darwin and Windows, the function will only ensure that some notion of monotonic nanoseconds are returned. In Darwin for example, this results in a monotonic time returned which is relative to the first call to the function.
TEMU_API uint64_t temu_timeGetThreadWct | ( | void | ) |
temu_timeGetThreadWct Returns wall clock nanoseconds of thread time (i.e. how much time the thread this is called from has been scheduled)