aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/redshift.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/redshift.c b/src/redshift.c
index f8c0d30..1c8723c 100644
--- a/src/redshift.c
+++ b/src/redshift.c
@@ -281,6 +281,10 @@ static const location_provider_t location_providers[] = {
#define TRANSITION_LOW SOLAR_CIVIL_TWILIGHT_ELEV
#define TRANSITION_HIGH 3.0
+/* Duration of sleep between screen updates (milliseconds). */
+#define SLEEP_DURATION 5000
+#define SLEEP_DURATION_SHORT 100
+
/* Program modes. */
typedef enum {
PROGRAM_MODE_CONTINUAL,
@@ -290,7 +294,6 @@ typedef enum {
PROGRAM_MODE_MANUAL
} program_mode_t;
-
#if defined(HAVE_SIGNAL_H) && !defined(__WIN32__)
static volatile sig_atomic_t exiting = 0;
@@ -1485,11 +1488,11 @@ main(int argc, char *argv[])
/* Sleep for 5 seconds or 0.1 second. */
#ifndef _WIN32
- if (short_trans_delta) usleep(100000);
- else usleep(5000000);
+ if (short_trans_delta) usleep(SLEEP_DURATION_SHORT*1000);
+ else usleep(SLEEP_DURATION*1000);
#else /* ! _WIN32 */
- if (short_trans_delta) Sleep(100);
- else Sleep(5000);
+ if (short_trans_delta) Sleep(SLEEP_DURATION_SHORT);
+ else Sleep(SLEEP_DURATION);
#endif /* ! _WIN32 */
}