#include <stdbool.h>
#include <stdlib.h>
Go to the source code of this file.
◆ timer_to_string
Only for debug, it returns the timer in the form of a string
- Note
- Caller MUST free the memory allocated for the string
◆ create_timer()
Creates a timer object with the duration (in seconds) passed by argument
- Note
- It does NOT start running!
- Parameters
-
| duration | The duration (in seconds) that the timer will save |
◆ get_actual_time_milliseconds()
| float get_actual_time_milliseconds |
( |
void |
| ) |
|
Returns the ticks elapsed in milliseconds
◆ get_actual_time_seconds()
| float get_actual_time_seconds |
( |
void |
| ) |
|
Returns the ticks elapsed in seconds
◆ is_timer_up()
Returns true if the timer stops and call reset_timer with the given timer; returns false if the timer has yet not finished
- Note
- If the timer is inactive, the function will always return false (inactive is equal to running)
- Parameters
-
| timer | A pointer to the timer to check |
◆ reset_timer()
Sets the timer to not running
- Parameters
-
| timer | A pointer to the timer to reset |
◆ start_timer()
Starts the given timer
- Parameters
-
| timer | A pointer to the timer to start |
◆ timer_to_string_with_name()
| char * timer_to_string_with_name |
( |
const trc_timer_t |
timer, |
|
|
const char * |
timer_name |
|
) |
| |
- Note
- Remember to free the memory allocated for the string!