< prev index next >
src/java.base/unix/native/libjli/java_md_solinux.h
Print this page
*** 32,43 ****
*/
#include <sys/time.h>
#define CounterGet() (gethrtime()/1000)
#define Counter2Micros(counts) (counts)
#else /* ! HAVE_GETHRTIME */
! #define CounterGet() (0)
! #define Counter2Micros(counts) (1)
#endif /* HAVE_GETHRTIME */
/* pointer to environment */
extern char **environ;
--- 32,57 ----
*/
#include <sys/time.h>
#define CounterGet() (gethrtime()/1000)
#define Counter2Micros(counts) (counts)
#else /* ! HAVE_GETHRTIME */
! /*
! * * Add gethrtime() implementation for launch time debug on Linux.
! * */
! #include <sys/time.h>
! inline uint64_t gethrtime() {
! uint64_t result = 0;
! struct timeval tv;
! if (gettimeofday(&tv, NULL) != -1) {
! result = 1000000LL * (uint64_t)tv.tv_sec;
! result += (uint64_t)tv.tv_usec;
! }
! return result;
! }
!
! #define CounterGet() (gethrtime())
! #define Counter2Micros(counts) (counts)
#endif /* HAVE_GETHRTIME */
/* pointer to environment */
extern char **environ;
< prev index next >