-
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:
-
callbackFunction that will be called -
dataArgument sent to the callback function when it's called -
usPeriod 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:
-
callbackFunction that will be called -
dataArgument sent to the callback function when it's called -
sPeriod 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:
-
callbackFunction that is called repeatedly -
dataArgument sent to the callback function each time it's called -
usPeriod 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:
-
callbackFunction that is called repeatedly -
dataArgument sent to the callback function each time it's called -
sPeriod 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:
-
idValue returned by CallEvery and CallIn functions
Busy waits for given time
void WaitUS(tTime ms);
Parameters:
-
msAmount of time to wait, specified in milliseconds
Busy waits for given time
void Wait(float s);
Parameters:
-
sAmount of time to wait, specified in seconds