[#absl-Trunc] = xref:absl.adoc[absl]::Trunc :relfileprefix: ../ :mrdocs: Truncates a duration (toward zero) to a multiple of a non‐zero unit. == Synopsis Declared in `<absl/time/time.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:absl/Duration.adoc[Duration] Trunc( xref:absl/Duration.adoc[Duration] d, xref:absl/Duration.adoc[Duration] unit); ---- == Description Example: absl::Duration d = absl::Nanoseconds(123456789); absl::Duration a = absl::Trunc(d, absl::Microseconds(1)); // 123456us == Return Value `d` truncated toward zero to a multiple of `unit`. == Parameters [cols="1,4"] |=== | Name| Description | *d* | The duration to truncate. | *unit* | The unit to truncate to. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#