Files
runwhenidle/time_utils.h
Konstantin Pereiaslov 592c4e239f Account for the time it took to pause the command when calculating how long to sleep for.
Possibly unnecessary as this always seems to be 0 on my machine.
2023-05-20 00:40:08 -05:00

15 lines
402 B
C

#ifndef RUNWHENIDLE_TIME_UTILS_H
#define RUNWHENIDLE_TIME_UTILS_H
#include <time.h>
/**
* Calculates the elapsed time in milliseconds between two `struct timespec` values.
*
* @param start The starting time.
* @param end The ending time.
* @return The elapsed time in milliseconds.
*/
long long get_elapsed_time_ms(struct timespec start, struct timespec end);
#endif //RUNWHENIDLE_TIME_UTILS_H