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. |
1319 timeval time; |
1319 timeval time; |
1320 int status = gettimeofday(&time, NULL); |
1320 int status = gettimeofday(&time, NULL); |
1321 assert(status != -1, "linux error"); |
1321 assert(status != -1, "linux error"); |
1322 return jlong(time.tv_sec) * 1000 + jlong(time.tv_usec / 1000); |
1322 return jlong(time.tv_sec) * 1000 + jlong(time.tv_usec / 1000); |
1323 } |
1323 } |
|
1324 |
|
1325 void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) { |
|
1326 timeval time; |
|
1327 int status = gettimeofday(&time, NULL); |
|
1328 assert(status != -1, "linux error"); |
|
1329 seconds = jlong(time.tv_sec); |
|
1330 nanos = jlong(time.tv_usec) * 1000; |
|
1331 } |
|
1332 |
1324 |
1333 |
1325 #ifndef CLOCK_MONOTONIC |
1334 #ifndef CLOCK_MONOTONIC |
1326 #define CLOCK_MONOTONIC (1) |
1335 #define CLOCK_MONOTONIC (1) |
1327 #endif |
1336 #endif |
1328 |
1337 |