]>
git.proxmox.com Git - ceph.git/blob - ceph/src/dmclock/src/dmclock_util.h
d12c6f9eb63c9a61b9ae6446386c3d27b82137d4
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
5 * Copyright (C) 2017 Red Hat Inc.
23 // we're using double to represent time, but we could change it by
24 // changing the following declarations (and by making sure a min
27 static const Time TimeZero
= 0.0;
28 static const Time TimeMax
= std::numeric_limits
<Time
>::max();
29 static const double NaN
= nan("");
32 inline Time
get_time() {
34 auto result
= gettimeofday(&now
, NULL
);
37 return now
.tv_sec
+ (now
.tv_usec
/ 1000000.0);
40 std::string
format_time(const Time
& time
, uint modulo
= 1000);
44 } // namespace dmclock
45 } // namespace crimson