aboutsummaryrefslogtreecommitdiffstats
path: root/src/redshift.c
diff options
context:
space:
mode:
authorJon Lund Steffensen <jonlst@gmail.com>2014-12-27 20:41:28 -0500
committerJon Lund Steffensen <jonlst@gmail.com>2014-12-27 20:46:59 -0500
commit6ecbfe324f473cf255d08aced5ee2a819a578090 (patch)
tree74a1c4527136340bbae816626a13310e3e5bf531 /src/redshift.c
parentMerge branch 'color-settings-struct' (diff)
downloadredshift-ng-6ecbfe324f473cf255d08aced5ee2a819a578090.tar.gz
redshift-ng-6ecbfe324f473cf255d08aced5ee2a819a578090.tar.bz2
redshift-ng-6ecbfe324f473cf255d08aced5ee2a819a578090.tar.xz
redshift: Change duration of sleep to macro
Diffstat (limited to 'src/redshift.c')
-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 */
}