Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Functions
TimeUtils.c File Reference
#include "../../Inc/Utils/TimeUtils.h"
Include dependency graph for TimeUtils.c:

Go to the source code of this file.

Functions

double getCurrentTime ()
 Retrieves the current time in seconds. More...
 
double measureInterval (double lastIntervalTime)
 Measures the time interval since the last recorded time. More...
 

Function Documentation

◆ getCurrentTime()

double getCurrentTime ( )

Retrieves the current time in seconds.

Returns
double The current time in seconds.

Definition at line 3 of file TimeUtils.c.

3 {
4 return (double)clock() / CLOCKS_PER_SEC;
5}
Here is the caller graph for this function:

◆ measureInterval()

double measureInterval ( double  lastIntervalTime)

Measures the time interval since the last recorded time.

Parameters
lastIntervalTimeThe last recorded time in seconds.
Returns
double The time interval in seconds.

Definition at line 7 of file TimeUtils.c.

7 {
8 double currentTime = getCurrentTime();
9 double interval = currentTime - lastIntervalTime;
10 return interval;
11}
double getCurrentTime()
Retrieves the current time in seconds.
Definition: TimeUtils.c:3
Here is the call graph for this function:
Here is the caller graph for this function: