Constructs a Duration from a floating-point number of nanoseconds.
Declared in <absl/time/time.h>
template<
typename T,
/* implementation-defined */ = 0>
Duration
Nanoseconds(T n);
Factory overloads for constructing Duration values from a floating-point number of the unit indicated by the factory function's name. These functions exist for convenience, but they are not as efficient as the integral factories, which should be preferred.
Example:
auto a = absl::Seconds(1.5); // OK auto b = absl::Milliseconds(1500); // BETTER
A duration of n nanoseconds.
| Name | Description |
|---|---|
| n | The number of nanoseconds. |