equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 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. |
1472 if (gettimeofday(&t, NULL) == -1) { |
1472 if (gettimeofday(&t, NULL) == -1) { |
1473 fatal(err_msg("os::javaTimeMillis: gettimeofday (%s)", strerror(errno))); |
1473 fatal(err_msg("os::javaTimeMillis: gettimeofday (%s)", strerror(errno))); |
1474 } |
1474 } |
1475 return jlong(t.tv_sec) * 1000 + jlong(t.tv_usec) / 1000; |
1475 return jlong(t.tv_sec) * 1000 + jlong(t.tv_usec) / 1000; |
1476 } |
1476 } |
|
1477 |
|
1478 void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) { |
|
1479 timeval t; |
|
1480 if (gettimeofday(&t, NULL) == -1) { |
|
1481 fatal(err_msg("os::javaTimeSystemUTC: gettimeofday (%s)", strerror(errno))); |
|
1482 } |
|
1483 seconds = jlong(t.tv_sec); |
|
1484 nanos = jlong(t.tv_usec) * 1000; |
|
1485 } |
|
1486 |
1477 |
1487 |
1478 jlong os::javaTimeNanos() { |
1488 jlong os::javaTimeNanos() { |
1479 return (jlong)getTimeNanos(); |
1489 return (jlong)getTimeNanos(); |
1480 } |
1490 } |
1481 |
1491 |