-
Notifications
You must be signed in to change notification settings - Fork 0
time.h
Go to the source code for time.h
#include "common.h"
Initializes a system timer with microsecond resolution
void InitializeSystemTime(void);
Outputs system time
tTime GetTimeUS(void);
Returns:
- System time in microseconds
Outputs system time
float GetTime(void);
Returns:
- System time in seconds
Schedules a callback function to be called in given time
int CallInUS(tCallback callback, void *data, tTime us);
Parameters:
-
callback
Function that will be called -
data
Argument sent to the callback function when it's called -
us
Period between calls, specified in microseconds
Returns:
- ID that can be used to stop the call with CallStop
Schedules a callback function to be called in given time
int CallIn(tCallback callback, void *data, float s);
Parameters:
-
callback
Function that will be called -
data
Argument sent to the callback function when it's called -
s
Period between calls, specified in seconds
Returns:
- ID that can be used to stop the call with CallStop
Schedules a callback function to be called repeatedly
int CallEveryUS(tCallback callback, void *data, tTime us);
Parameters:
-
callback
Function that is called repeatedly -
data
Argument sent to the callback function each time it's called -
us
Period between calls, specified in microseconds
Returns:
- ID that can be used to stop the call with CallStop
Schedules a callback function to be called repeatedly
int CallEvery(tCallback callback, void *data, float s);
Parameters:
-
callback
Function that is called repeatedly -
data
Argument sent to the callback function each time it's called -
s
Period between calls, specified in seconds
Returns:
- ID that can be used to stop the call with CallStop
Stops a pending call based on the passed identifier
void CallStop(int id);
Parameters:
-
id
Value returned by CallEvery and CallIn functions
Busy waits for given time
void WaitUS(tTime ms);
Parameters:
-
ms
Amount of time to wait, specified in milliseconds
Busy waits for given time
void Wait(float s);
Parameters:
-
s
Amount of time to wait, specified in seconds