[#BloombergLP-bsls-TimeInterval-2constructor-07]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::xref:BloombergLP/bsls/TimeInterval.adoc[TimeInterval]::TimeInterval
:relfileprefix: ../../../
:mrdocs:

Create a time interval from an explicitly convertible `duration`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class REP&lowbar;TYPE,
    class PERIOD&lowbar;TYPE&gt;
constexpr
explicit
TimeInterval(std::chrono::duration&lt;REP&lowbar;TYPE, PERIOD&lowbar;TYPE&gt; const& duration)
requires TimeInterval&lowbar;DurationTraits&lt;
                                   REP&lowbar;TYPE,
                                   PERIOD&lowbar;TYPE&gt;&colon;&colon;k&lowbar;EXPLICIT&lowbar;CONVERSION&lowbar;ENABLED;
----

== Description

Create a time interval having the value represented by the specified `duration` when the conversion requires an explicit constructor&period; See the implicit overload for additional details on behavior and preconditions&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *duration*
| chrono duration to convert
|===


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