proxygen
Time.cpp File Reference
#include <folly/portability/Time.h>
#include <folly/CPortability.h>
#include <folly/Likely.h>
#include <assert.h>
#include <chrono>

Go to the source code of this file.

Functions

template<typename _Rep , typename _Period >
static void duration_to_ts (std::chrono::duration< _Rep, _Period > d, struct timespec *ts)
 

Function Documentation

template<typename _Rep , typename _Period >
static void duration_to_ts ( std::chrono::duration< _Rep, _Period >  d,
struct timespec *  ts 
)
static

Definition at line 27 of file Time.cpp.

References folly::chrono::clock_gettime, count, f, FOLLY_ATTR_WEAK, i, deadlock::info(), now(), s, folly::pushmi::detail::t, folly::pushmi::__adl::tp, and UNLIKELY.

29  {
30  ts->tv_sec =
31  time_t(std::chrono::duration_cast<std::chrono::seconds>(d).count());
32  ts->tv_nsec = long(std::chrono::duration_cast<std::chrono::nanoseconds>(
33  d % std::chrono::seconds(1))
34  .count());
35 }
int * count