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

Parses a duration string consisting of a possibly signed sequence of decimal numbers, each with an optional fractional part and a unit suffix&period; The valid suffixes are &quot;ns&quot;, &quot;us&quot; &quot;ms&quot;, &quot;s&quot;, &quot;m&quot;, and &quot;h&quot;&period; Simple examples include &quot;300ms&quot;, &quot;&hyphen;1&period;5h&quot;, and &quot;2h45m&quot;&period; Parses &quot;0&quot; as `ZeroDuration()`&period; Parses &quot;inf&quot; and &quot;&hyphen;inf&quot; as &plus;&sol;&hyphen; `InfiniteDuration()`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
ParseDuration(
    std::string&lowbar;view dur&lowbar;string,
    xref:absl/Duration.adoc[Duration]* d);
----

== Return Value

`true` upon successful parsing&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dur&lowbar;string*
| The string to parse&period;
| *d*
| Output parameter receiving the parsed duration&period;
|===


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