X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=timing.c;h=696c1e1d7ce58281052299dbc9c8bb2e3e49d67c;hb=1c1419bfce92bbdf70489a502bb2b2ba84690f39;hp=11a0305000b94ba753f31a8afee75445172c1a43;hpb=d5836982e23d8a6176114e1073469950c4eaae37;p=PuTTY.git diff --git a/timing.c b/timing.c index 11a03050..696c1e1d 100644 --- a/timing.c +++ b/timing.c @@ -148,6 +148,17 @@ unsigned long schedule_timer(int ticks, timer_fn_t fn, void *ctx) return when; } +unsigned long timing_last_clock(void) +{ + /* + * Return the last value we stored in 'now'. In particular, + * calling this just after schedule_timer returns the value of + * 'now' that was used to decide when the timer you just set would + * go off. + */ + return now; +} + /* * Call to run any timers whose time has reached the present. * Returns the time (in ticks) expected until the next timer after @@ -174,8 +185,8 @@ int run_timers(unsigned long anow, unsigned long *next) */ delpos234(timers, 0); sfree(first); - } else if (now - first->when_set - 10 > - first->now - first->when_set - 10) { + } else if (now - (first->when_set - 10) > + first->now - (first->when_set - 10)) { /* * This timer is active and has reached its running * time. Run it.