removing microsecond accuracy for now

This commit is contained in:
jon 2020-09-30 21:32:30 +02:00
parent 93130338e2
commit 3ecf9e2444
2 changed files with 3 additions and 17 deletions

View File

@ -537,9 +537,4 @@ static inline void wintype_arr_enable(bool arr[]) {
/** /**
* Get current system clock in milliseconds. * Get current system clock in milliseconds.
*/ */
int64_t get_time_ms(void); int64_t get_time_ms(void);
/**
* Get current system clock in microseconds * 40.
*/
int64_t get_time_40us(void);

View File

@ -127,16 +127,7 @@ int64_t get_time_ms(void) {
struct timespec tp; struct timespec tp;
clock_gettime(CLOCK_MONOTONIC, &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 * 1000 + (int64_t)tp.tv_nsec / 1000000;
} // return (int64_t)tp.tv_sec * 100 + (int64_t)tp.tv_nsec / 250000;
/**
* 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;
} }
// XXX Move to x.c // XXX Move to x.c
@ -434,7 +425,7 @@ static struct managed_win *paint_preprocess(session_t *ps, bool *fade_running) {
// Fading step calculation // Fading step calculation
long steps = 0L; long steps = 0L;
auto now = get_time_40us(); auto now = get_time_ms();
if (ps->fade_time) { if (ps->fade_time) {
assert(now >= ps->fade_time); assert(now >= ps->fade_time);
steps = (now - ps->fade_time) / ps->o.fade_delta; steps = (now - ps->fade_time) / ps->o.fade_delta;