TMR_GetPerfFrequency
This command will return the frequency of the high-resolution performance counter.
Returns Double Integer = TMR_GetPerfFrequency( *No Parameters* )
This will return a Double Integer such as 1. This number is the amount of ticks That occures every second.
This command will return the current value of the high-resolution performance counter.
This command will return the frequency of the high-resolution performance counter.
By taking the value of the TMR_GetPerfCounter
and dividing by the frequency, you get the number of seconds that have elapsed since the system was turned on.
This value will not change at any time when the system is running, so you will only need to call this command once.
// Because the values returned by these functions are high-res, we need to
// define the variables as double integers or we will get incorrect values.
Freq as Double Integer
Ticks as Double Integer
// Get the amount of ticks per second
Freq = TMR_GetPerfFrequency()
Do
CLS
// Get the current amount of ticks
Ticks = TMR_GetPerfCounter()
// Calculate Seconds since power on by dividing Ticks by the Freqency
Seconds = Ticks / Freq
// display seconds since power on
Print "Seconds since power on: ",str$(Seconds)
Loop
Counter Commands Menu
ShaunRW`s Commands