From ba422bd78ec0d78611d0bced54c98d80da20a18d Mon Sep 17 00:00:00 2001 From: Jon Lund Steffensen Date: Sun, 28 Dec 2014 13:13:21 -0500 Subject: systemtime: Add function wrapping platform sleep function Adds systemtime_msleep() which sleeps for a number of milliseconds. This wraps Sleep() on windows and usleep() on other platforms. --- src/redshift.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/redshift.c') diff --git a/src/redshift.c b/src/redshift.c index b09f39c..5f7d22b 100644 --- a/src/redshift.c +++ b/src/redshift.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -1583,13 +1582,11 @@ main(int argc, char *argv[]) sizeof(color_setting_t)); /* Sleep for 5 seconds or 0.1 second. */ -#ifndef _WIN32 - if (short_trans_delta) usleep(SLEEP_DURATION_SHORT*1000); - else usleep(SLEEP_DURATION*1000); -#else /* ! _WIN32 */ - if (short_trans_delta) Sleep(SLEEP_DURATION_SHORT); - else Sleep(SLEEP_DURATION); -#endif /* ! _WIN32 */ + if (short_trans_delta) { + systemtime_msleep(SLEEP_DURATION_SHORT); + } else { + systemtime_msleep(SLEEP_DURATION); + } } /* Restore saved gamma ramps */ -- cgit v1.2.3-70-g09d2