Skip to content

Commit

Permalink
Fix nano calculation (#513)
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWharton authored Sep 23, 2024
1 parent 66e5397 commit a419585
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Changed:
- Nothing yet!

Fixed:
- Nothing yet!
- Correct calculation of frame nano time for native Windows and native Linux targets.


## [2.0.0] - 2024-05-28
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ import platform.posix.timespec
internal actual inline fun nanoTime(): Long = memScoped {
val timespec = alloc<timespec>()
clock_gettime(CLOCK_MONOTONIC_RAW, timespec.ptr)
timespec.tv_nsec * 1_000_000L + timespec.tv_nsec
timespec.tv_sec * 1_000_000L + timespec.tv_nsec
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ import platform.posix.timespec
internal actual inline fun nanoTime(): Long = memScoped {
val timespec = alloc<timespec>()
clock_gettime(CLOCK_MONOTONIC, timespec.ptr)
timespec.tv_nsec * 1_000_000L + timespec.tv_nsec
timespec.tv_sec * 1_000_000L + timespec.tv_nsec
}

0 comments on commit a419585

Please sign in to comment.