Skip to content

Commit b4448cd

Browse files
authored
Fix millis on the emulator incorrectly converting the microseconds (#315)
* Fix millis incorrectly converting the microseconds * clang-format
1 parent 9154b53 commit b4448cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Primitives/emulated.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ def_prim(abort, NoneToNoneU32) {
246246
}
247247

248248
def_prim(millis, NoneToOneU64) {
249-
struct timeval tv{};
249+
timeval tv{};
250250
gettimeofday(&tv, nullptr);
251-
unsigned long millis = 1000 * tv.tv_sec + tv.tv_usec;
251+
const uint64_t millis = 1000 * tv.tv_sec + tv.tv_usec / 1000;
252252
pushUInt64(millis);
253253
return true;
254254
}

0 commit comments

Comments
 (0)