Skip to content

Commit

Permalink
Merge pull request #6569 from eclipse/revert-6568-macos_hiresClock
Browse files Browse the repository at this point in the history
Revert "macOS: Use clock_gettime_nsec_np() for omrtime_hires_clock()"
  • Loading branch information
0xdaryl committed Jun 15, 2022
2 parents c5700ab + d33c6ae commit 0aa4535
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions port/unix/omrtime.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1991, 2022 IBM Corp. and others
* Copyright (c) 1991, 2016 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -154,14 +154,10 @@ omrtime_current_time_millis(struct OMRPortLibrary *portLibrary)
uint64_t
omrtime_hires_clock(struct OMRPortLibrary *portLibrary)
{
#if defined(OSX)
return clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW) / 1000;
#else /* defined(OSX) */
struct timeval tp;

gettimeofday(&tp, NULL);
return ((uint64_t)tp.tv_sec * 1000000) + (uint64_t)tp.tv_usec;
#endif /* defined(OSX) */
}
/**
* Query OS for clock frequency
Expand Down

0 comments on commit 0aa4535

Please sign in to comment.