diff options
Diffstat (limited to 'usr.bin/ssh/misc.c')
-rw-r--r-- | usr.bin/ssh/misc.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/ssh/misc.c b/usr.bin/ssh/misc.c index e81d2a161f4..f1c0a973540 100644 --- a/usr.bin/ssh/misc.c +++ b/usr.bin/ssh/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.101 2016/01/20 09:22:39 dtucker Exp $ */ +/* $OpenBSD: misc.c,v 1.102 2016/03/02 22:42:40 dtucker Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2005,2006 Damien Miller. All rights reserved. @@ -871,6 +871,17 @@ monotime(void) return (ts.tv_sec); } +double +monotime_double(void) +{ + struct timespec ts; + + if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) + fatal("clock_gettime: %s", strerror(errno)); + + return (ts.tv_sec + (double)ts.tv_nsec / 1000000000); +} + void bandwidth_limit_init(struct bwlimit *bw, u_int64_t kbps, size_t buflen) { |