Support fractional-second intervals on recurring timers
A fractional-second timeout was already supported for the initial timeout of a /TIMER, but if the timer was recurring then the interval was rounded to a whole number of seconds for the subsequent timeouts. Change the type of interval from long to double to fix this.
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
[Changes 1.2.2]
|
[Changes 1.2.2]
|
||||||
|
|
||||||
|
* Support fractional-second intervals on recurring timers. (caf)
|
||||||
|
|
||||||
* Change $geom() to return current screen's geometry, not the original
|
* Change $geom() to return current screen's geometry, not the original
|
||||||
terminal's. (caf)
|
terminal's. (caf)
|
||||||
|
|
||||||
|
|||||||
@@ -1043,7 +1043,7 @@ typedef struct timerlist_stru
|
|||||||
char *command;
|
char *command;
|
||||||
char *subargs;
|
char *subargs;
|
||||||
int events;
|
int events;
|
||||||
time_t interval;
|
double interval;
|
||||||
int server;
|
int server;
|
||||||
int window;
|
int window;
|
||||||
char *whom;
|
char *whom;
|
||||||
|
|||||||
@@ -421,8 +421,8 @@ char *function_timer(char *n, char *args)
|
|||||||
if (time_left < 0)
|
if (time_left < 0)
|
||||||
time_left = 0.0;
|
time_left = 0.0;
|
||||||
|
|
||||||
return m_sprintf("%s %d %d %ld %d %0.3f %s%s", t->ref, t->server,
|
return m_sprintf("%s %d %d %.16g %d %0.3f %s%s", t->ref, t->server,
|
||||||
t->window, (long)t->interval, t->events, time_left,
|
t->window, t->interval, t->events, time_left,
|
||||||
t->callback ? "(internal callback) " : t->command,
|
t->callback ? "(internal callback) " : t->command,
|
||||||
t->whom ? t->whom : "");
|
t->whom ? t->whom : "");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user