diff options
author | 2022-08-04 21:40:48 -0700 | |
---|---|---|
committer | 2022-08-04 21:40:48 -0700 | |
commit | 2b55f2d00f0da703a1f89d6f21049733dfcc89b8 (patch) | |
tree | b163301481bb3396ef15727cc60ae17ab32a53b9 | |
parent | 4d1997066309328deaa79ebcdd9359875009277a (diff) | |
download | bun-2b55f2d00f0da703a1f89d6f21049733dfcc89b8.tar.gz bun-2b55f2d00f0da703a1f89d6f21049733dfcc89b8.tar.zst bun-2b55f2d00f0da703a1f89d6f21049733dfcc89b8.zip |
Allow timer with 0 -> 1
-rw-r--r-- | src/bun.js/api/bun.zig | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/bun.js/api/bun.zig b/src/bun.js/api/bun.zig index 7c0d1b32f..708467402 100644 --- a/src/bun.js/api/bun.zig +++ b/src/bun.js/api/bun.zig @@ -2242,13 +2242,10 @@ pub const Timer = struct { this, onCallback, &this.completion, - std.time.ns_per_ms * @intCast( + if (this.interval > 0) std.time.ns_per_ms * @intCast( u63, - @maximum( - this.interval, - 1, - ), - ), + this.interval, + ) else 1, ); } |