From 3ecf9e24441bd16faa39d8ee23471560fbf395b5 Mon Sep 17 00:00:00 2001 From: jon Date: Wed, 30 Sep 2020 21:32:30 +0200 Subject: [PATCH] removing microsecond accuracy for now --- src/common.h | 7 +------ src/picom.c | 13 ++----------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/common.h b/src/common.h index 341dc7d..42d9661 100644 --- a/src/common.h +++ b/src/common.h @@ -537,9 +537,4 @@ static inline void wintype_arr_enable(bool arr[]) { /** * Get current system clock in milliseconds. */ -int64_t get_time_ms(void); - -/** - * Get current system clock in microseconds * 40. - */ -int64_t get_time_40us(void); +int64_t get_time_ms(void); \ No newline at end of file diff --git a/src/picom.c b/src/picom.c index 97e921e..d06a77c 100644 --- a/src/picom.c +++ b/src/picom.c @@ -127,16 +127,7 @@ int64_t get_time_ms(void) { struct timespec tp; clock_gettime(CLOCK_MONOTONIC, &tp); return (int64_t)tp.tv_sec * 1000 + (int64_t)tp.tv_nsec / 1000000; -} - -/** - * Get current system clock in microseconds * 40. - */ -int64_t get_time_40us(void) { - struct timespec tp; - clock_gettime(CLOCK_MONOTONIC, &tp); - // return (int64_t)tp.tv_sec * 1000 + (int64_t)tp.tv_nsec / 1000000; - return (int64_t)tp.tv_sec * 100 + (int64_t)tp.tv_nsec / 250000; + // return (int64_t)tp.tv_sec * 100 + (int64_t)tp.tv_nsec / 250000; } // XXX Move to x.c @@ -434,7 +425,7 @@ static struct managed_win *paint_preprocess(session_t *ps, bool *fade_running) { // Fading step calculation long steps = 0L; - auto now = get_time_40us(); + auto now = get_time_ms(); if (ps->fade_time) { assert(now >= ps->fade_time); steps = (now - ps->fade_time) / ps->o.fade_delta;