[#BloombergLP-bsls-TimeInterval-asDuration]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::xref:BloombergLP/bsls/TimeInterval.adoc[TimeInterval]::asDuration
:relfileprefix: ../../../
:mrdocs:

Return this interval as a `std&colon;&colon;chrono&colon;&colon;duration` object&period;

== Synopsis

Declared in `&lt;bsls&lowbar;timeinterval&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class DURATION&lowbar;TYPE&gt;
constexpr
DURATION&lowbar;TYPE
asDuration() const
requires TimeInterval&lowbar;IsDuration&lt;DURATION&lowbar;TYPE&gt;&colon;&colon;value &amp;&amp;
              !TimeInterval&lowbar;RepTraits&lt;typename DURATION&lowbar;TYPE&colon;&colon;rep&gt;&colon;&colon;k&lowbar;IS&lowbar;FLOAT;
----

== Description

Return the value of this time interval as a `std&colon;&colon;chrono&colon;&colon;duration` object&period; This function participates in overloading if `DURATION&lowbar;TYPE` is actually an `std&colon;&colon;chrono&colon;&colon;duration` instance, and if it has _not_ a floating point representation&period; The behavior is undefined unless the total number of nanoseconds can be represented using a `DURATION&lowbar;TYPE`&period; Note that the return value may be negative&period;

== Return Value

this interval as a `DURATION&lowbar;TYPE` chrono duration


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