[#absl-Nanoseconds-0a]
= xref:absl.adoc[absl]::Nanoseconds
:relfileprefix: ../
:mrdocs:

Constructs a `Duration` from an integral number of nanoseconds&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename T,
    &sol;&ast; implementation-defined &ast;&sol; = 0&gt;
constexpr
xref:absl/Duration.adoc[Duration]
Nanoseconds(T n);
----

== Description

Factory functions for constructing `Duration` values from an integral number of the unit indicated by the factory function&apos;s name&period; The number must be representable as int64&lowbar;t&period;

NOTE&colon; no &quot;Days()&quot; factory function exists because &quot;a day&quot; is ambiguous&period; Civil days are not always 24 hours long, and a 24&hyphen;hour duration often does not correspond with a civil day&period; If a 24&hyphen;hour duration is needed, use `absl&colon;&colon;Hours(24)`&period; If you actually want a civil day, use absl&colon;&colon;CivilDay from civil&lowbar;time&period;h&period;

Example&colon;

absl&colon;&colon;Duration a &equals; absl&colon;&colon;Seconds(60)&semi; absl&colon;&colon;Duration b &equals; absl&colon;&colon;Minutes(1)&semi; &sol;&sol; b &equals;&equals; a

== Return Value

A duration of `n` nanoseconds&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *n*
| The number of nanoseconds&period;
|===


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