mirror of
https://github.com/janet-lang/janet
synced 2025-08-02 20:13:56 +00:00
Allow infinite wait to work without issues.
This commit is contained in:
parent
55af6ce834
commit
9582d3c623
@ -172,6 +172,9 @@ static JanetTimestamp ts_now(void);
|
|||||||
|
|
||||||
/* Get current timestamp + an interval (millisecond precision) */
|
/* Get current timestamp + an interval (millisecond precision) */
|
||||||
static JanetTimestamp ts_delta(JanetTimestamp ts, double delta) {
|
static JanetTimestamp ts_delta(JanetTimestamp ts, double delta) {
|
||||||
|
if (isinf(delta)) {
|
||||||
|
return delta < 0 ? ts : INT64_MAX;
|
||||||
|
}
|
||||||
ts += (int64_t)round(delta * 1000);
|
ts += (int64_t)round(delta * 1000);
|
||||||
return ts;
|
return ts;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user