equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
980 jlong os::javaTimeMillis() { |
980 jlong os::javaTimeMillis() { |
981 timeval time; |
981 timeval time; |
982 int status = gettimeofday(&time, NULL); |
982 int status = gettimeofday(&time, NULL); |
983 assert(status != -1, "bsd error"); |
983 assert(status != -1, "bsd error"); |
984 return jlong(time.tv_sec) * 1000 + jlong(time.tv_usec / 1000); |
984 return jlong(time.tv_sec) * 1000 + jlong(time.tv_usec / 1000); |
|
985 } |
|
986 |
|
987 void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) { |
|
988 timeval time; |
|
989 int status = gettimeofday(&time, NULL); |
|
990 assert(status != -1, "bsd error"); |
|
991 seconds = jlong(time.tv_sec); |
|
992 nanos = jlong(time.tv_usec) * 1000; |
985 } |
993 } |
986 |
994 |
987 #ifndef __APPLE__ |
995 #ifndef __APPLE__ |
988 #ifndef CLOCK_MONOTONIC |
996 #ifndef CLOCK_MONOTONIC |
989 #define CLOCK_MONOTONIC (1) |
997 #define CLOCK_MONOTONIC (1) |