Returns the ceiling of a duration using the passed duration unit to its smallest value not less than the duration.

Synopsis

Declared in <absl/time/time.h>

Duration
Ceil(
    Duration d,
    Duration unit);

Description

Example:

absl::Duration d = absl::Nanoseconds(123456789); absl::Duration c = absl::Ceil(d, absl::Microseconds(1)); // 123457us

Return Value

d rounded up to a multiple of unit.

Parameters

Name

Description

d

The duration to take the ceiling of.

unit

The unit to take the ceiling to.

Created with MrDocs