[#BloombergLP-balm-StopwatchScopedGuard-2constructor-022]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::xref:BloombergLP/balm/StopwatchScopedGuard.adoc[StopwatchScopedGuard]::StopwatchScopedGuard
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

Declared in `&lt;balm&lowbar;stopwatchscopedguard&period;h&gt;`

Initialize this scoped guard to record an elapsed time to the specified `metricId`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/balm/StopwatchScopedGuard/2constructor-05.adoc[StopwatchScopedGuard](
    xref:BloombergLP/balm/MetricId.adoc[MetricId] const& metricId,
    xref:BloombergLP/balm/MetricsManager.adoc[MetricsManager]* manager = 0);
----

[.small]#xref:BloombergLP/balm/StopwatchScopedGuard/2constructor-05.adoc[_» more&period;&period;&period;_]#

Initialize this scoped guard to record elapsed time using the specified `collector`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/balm/StopwatchScopedGuard/2constructor-01.adoc[StopwatchScopedGuard](
    xref:BloombergLP/balm/Collector.adoc[Collector]* collector,
    xref:BloombergLP/balm/StopwatchScopedGuard/Units.adoc[Units] timeUnits = k&lowbar;SECONDS);
----

[.small]#xref:BloombergLP/balm/StopwatchScopedGuard/2constructor-01.adoc[_» more&period;&period;&period;_]#

Initialize this scoped guard to record elapsed time using the specified `metric`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/balm/StopwatchScopedGuard/2constructor-020.adoc[StopwatchScopedGuard](
    xref:BloombergLP/balm/Metric.adoc[Metric]* metric,
    xref:BloombergLP/balm/StopwatchScopedGuard/Units.adoc[Units] timeUnits = k&lowbar;SECONDS);
----

[.small]#xref:BloombergLP/balm/StopwatchScopedGuard/2constructor-020.adoc[_» more&period;&period;&period;_]#

Initialize this scoped guard to record an elapsed time to the specified `metricId` using the specified `timeUnits`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/balm/StopwatchScopedGuard/2constructor-0e.adoc[StopwatchScopedGuard](
    xref:BloombergLP/balm/MetricId.adoc[MetricId] const& metricId,
    xref:BloombergLP/balm/StopwatchScopedGuard/Units.adoc[Units] timeUnits,
    xref:BloombergLP/balm/MetricsManager.adoc[MetricsManager]* manager = 0);
----

[.small]#xref:BloombergLP/balm/StopwatchScopedGuard/2constructor-0e.adoc[_» more&period;&period;&period;_]#

Initialize this scoped guard to record an elapsed time to the metric identified by the specified `category` and `name`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/balm/StopwatchScopedGuard/2constructor-0f.adoc[StopwatchScopedGuard](
    char const* category,
    char const* name,
    xref:BloombergLP/balm/MetricsManager.adoc[MetricsManager]* manager = 0);
----

[.small]#xref:BloombergLP/balm/StopwatchScopedGuard/2constructor-0f.adoc[_» more&period;&period;&period;_]#

Initialize this scoped guard to record an elapsed time to the metric identified by the specified `category` and `name` using the specified `timeUnits`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/balm/StopwatchScopedGuard/2constructor-09.adoc[StopwatchScopedGuard](
    char const* category,
    char const* name,
    xref:BloombergLP/balm/StopwatchScopedGuard/Units.adoc[Units] timeUnits,
    xref:BloombergLP/balm/MetricsManager.adoc[MetricsManager]* manager = 0);
----

[.small]#xref:BloombergLP/balm/StopwatchScopedGuard/2constructor-09.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *metricId*
| identity of the metric to record
| *manager*
| metrics manager used to provide the collector (optional)
| *collector*
| collector used to record elapsed time
| *timeUnits*
| units in which to report elapsed time (optional)
| *metric*
| metric used to record elapsed time
| *category*
| null&hyphen;terminated metric category name
| *name*
| null&hyphen;terminated metric name
|===


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