UEFIStarter
a simple UEFI framework
|
Timing functions. More...
#include <Uefi.h>
Go to the source code of this file.
Functions | |
double | timestamp_diff_seconds (UINT64 start, UINT64 end) |
Calculates the number of seconds between two timestamps. More... | |
int | init_timestamps () |
Initializes the timestamp features. More... | |
UINT64 | get_timestamp () |
Fetches and returns the current timestamp. More... | |
UINT64 | get_timestamp_ticks_per_second () |
Returns the number of timestamp ticks per second. More... | |
double timestamp_diff_seconds | ( | UINT64 | start, |
UINT64 | end | ||
) |
Calculates the number of seconds between two timestamps.
This will only work if init_timestamps() has been called first.
start | the start of the timestamp interval |
end | the end of the timestamp interval |
int init_timestamps | ( | ) |
Initializes the timestamp features.
This will take ~2 seconds at current settings. This function takes the naive approach and simply measures how many ticks pass in 2 seconds. This tick frequency will be used later when converting ticks to seconds.
Make sure to call this function before you attempt to determine elapsed wallclock time.
UINT64 get_timestamp | ( | ) |
Fetches and returns the current timestamp.
UINT64 get_timestamp_ticks_per_second | ( | ) |
Returns the number of timestamp ticks per second.