[#absl-ToChronoNanoseconds]
= xref:absl.adoc[absl]::ToChronoNanoseconds
:relfileprefix: ../
:mrdocs:

Converts an absl&colon;&colon;Duration to a std&colon;&colon;chrono&colon;&colon;nanoseconds value&period;

== Synopsis

Declared in `&lt;absl&sol;time&sol;time&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::chrono::nanoseconds
ToChronoNanoseconds(xref:absl/Duration.adoc[Duration] d);
----

== Description

Converts an absl&colon;&colon;Duration to any of the pre&hyphen;defined std&colon;&colon;chrono durations&period; If overflow would occur, the returned value will saturate at the min&sol;max chrono duration value instead&period;

Example&colon;

absl&colon;&colon;Duration d &equals; absl&colon;&colon;Microseconds(123)&semi; auto x &equals; absl&colon;&colon;ToChronoMicroseconds(d)&semi; auto y &equals; absl&colon;&colon;ToChronoNanoseconds(d)&semi; &sol;&sol; x &equals;&equals; y auto z &equals; absl&colon;&colon;ToChronoSeconds(absl&colon;&colon;InfiniteDuration())&semi; &sol;&sol; z &equals;&equals; std&colon;&colon;chrono&colon;&colon;seconds&colon;&colon;max()

== Return Value

The equivalent std&colon;&colon;chrono&colon;&colon;nanoseconds value&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *d*
| The duration to convert&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
