mirror of
https://github.com/perk11/runwhenidle.git
synced 2026-01-09 13:48:01 -05:00
Make commands that fail, fail faster and move first idle check before first sleep, but after an initial 300ms sleep
This commit is contained in:
15
sleep_utils.h
Normal file
15
sleep_utils.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#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 */
|
||||
Reference in New Issue
Block a user