| /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| * Copyright (C) 2014 Named Data Networking Project |
| * See COPYING for copyright and distribution information. |
| int res = clock_gettime(CLOCK_MONOTONIC, &t); |
| throw std::runtime_error("clock_gettime"); |
| return Point(time::seconds(t.tv_sec) + time::nanoseconds(t.tv_nsec)); |
| // fallback to wall clock time |
| int res = gettimeofday(&tv, 0); |
| throw std::runtime_error("gettimeofday"); |
| return Point(time::seconds(tv.tv_sec) + time::microseconds(tv.tv_usec)); |