-
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"
###void InitializeSystemTime(void);
Initializes a system timer with microsecond resolution
###tTime GetTimeUS(void);
Outputs system time
Returns:
- System time in microseconds
###float GetTime(void);
Outputs system time
Returns:
- System time in seconds
###int CallInUS(tCallback callback, void *data, tTime us);
Schedules a callback function to be called in given time
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
###int CallIn(tCallback callback, void *data, float s);
Schedules a callback function to be called in given time
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
###int CallEveryUS(tCallback callback, void *data, tTime us);
Schedules a callback function to be called repeatedly
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
###int CallEvery(tCallback callback, void *data, float s);
Schedules a callback function to be called repeatedly
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
###void CallStop(int id);
Stops a pending call based on the passed identifier
Parameters:
-
id
Value returned by CallEvery and CallIn functions
###void WaitUS(tTime ms);
Busy waits for given time
Parameters:
-
ms
Amount of time to wait, specified in milliseconds
###void Wait(float s);
Busy waits for given time
Parameters:
-
s
Amount of time to wait, specified in seconds