mirror of
https://github.com/perk11/runwhenidle.git
synced 2026-01-06 20:33:57 -05:00
16 lines
436 B
C
16 lines
436 B
C
#ifndef SLEEP_UTILS_H
|
|
#define SLEEP_UTILS_H
|
|
|
|
#include <time.h>
|
|
#include <errno.h>
|
|
|
|
/**
|
|
* Sleeps for the specified number of milliseconds unless interrupted by a signal.
|
|
*
|
|
* @param milliseconds The number of milliseconds to sleep.
|
|
* @return 0 on success, -1 on failure or being interrupted by a signal (sets errno to EINVAL if milliseconds is negative).
|
|
*/
|
|
int sleep_for_milliseconds(long milliseconds);
|
|
|
|
#endif /* SLEEP_UTILS_H */
|