Floors a duration using the passed duration unit to its largest value not greater than the duration.

Synopsis

Declared in <absl/time/time.h>

Duration
Floor(
    Duration d,
    Duration unit);

Description

Example:

absl::Duration d = absl::Nanoseconds(123456789); absl::Duration b = absl::Floor(d, absl::Microseconds(1)); // 123456us

Return Value

d floored to a multiple of unit.

Parameters

Name

Description

d

The duration to floor.

unit

The unit to floor to.

Created with MrDocs