hotspot/src/os/linux/vm/os_linux.cpp
changeset 234 4da9c1bbc810
parent 1 489c9b5090e2
child 235 735f15bdea80
equal deleted inserted replaced
233:9f4505c94388 234:4da9c1bbc810
  1245 
  1245 
  1246 jlong os::elapsed_frequency() {
  1246 jlong os::elapsed_frequency() {
  1247   return (1000 * 1000);
  1247   return (1000 * 1000);
  1248 }
  1248 }
  1249 
  1249 
  1250 jlong os::timeofday() {
  1250 jlong os::javaTimeMillis() {
  1251   timeval time;
  1251   timeval time;
  1252   int status = gettimeofday(&time, NULL);
  1252   int status = gettimeofday(&time, NULL);
  1253   assert(status != -1, "linux error");
  1253   assert(status != -1, "linux error");
  1254   return jlong(time.tv_sec) * 1000  +  jlong(time.tv_usec / 1000);
  1254   return jlong(time.tv_sec) * 1000  +  jlong(time.tv_usec / 1000);
  1255 }
       
  1256 
       
  1257 // Must return millis since Jan 1 1970 for JVM_CurrentTimeMillis
       
  1258 // _use_global_time is only set if CacheTimeMillis is true
       
  1259 jlong os::javaTimeMillis() {
       
  1260   return (_use_global_time ? read_global_time() : timeofday());
       
  1261 }
  1255 }
  1262 
  1256 
  1263 #ifndef CLOCK_MONOTONIC
  1257 #ifndef CLOCK_MONOTONIC
  1264 #define CLOCK_MONOTONIC (1)
  1258 #define CLOCK_MONOTONIC (1)
  1265 #endif
  1259 #endif