Skip to content

Commit

Permalink
Reuse currentRes
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterJohnson committed Aug 2, 2024
1 parent 13cddb5 commit 8d10fda
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions hal/src/main/native/sim/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,9 @@ HAL_Bool HAL_Initialize(int32_t timeout, int32_t mode) {
ULONG min, max, current;
if (NtQueryTimerResolution(&min, &max, &current) == 0) {
static ULONG desired = max;
ULONG currentRes;
static ULONG currentRes;
if (NtSetTimerResolution(desired, TRUE, &currentRes) == 0) {
std::atexit([]() {
ULONG currentRes;
NtSetTimerResolution(desired, FALSE, &currentRes);
});
}
Expand Down

0 comments on commit 8d10fda

Please sign in to comment.