Converts a Duration to an integral count of nanoseconds.

Synopsis

Declared in <absl/time/time.h>

constexpr
int64_t
ToInt64Nanoseconds(Duration d);

Description

Helper functions that convert a Duration to an integral count of the indicated unit. These return the same results as the IDivDuration() function, though they usually do so more efficiently; see the documentation of IDivDuration() for details about overflow, etc.

Example:

absl::Duration d = absl::Milliseconds(1500); int64_t isec = absl::ToInt64Seconds(d); // isec == 1

Return Value

The number of whole nanoseconds in d.

Parameters

Name

Description

d

The duration to convert.

Created with MrDocs