[#BCLog-Timer-2constructor]
= xref:BCLog.adoc[BCLog]::xref:BCLog/Timer.adoc[Timer]::Timer
:relfileprefix: ../../
:mrdocs:

Constructs the timer, records the start time, and logs a &quot;started&quot; message&period;

== Synopsis

Declared in `&lt;logging&sol;timer&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
Timer(
    std::string prefix,
    std::string end&lowbar;msg,
    xref:BCLog/LogFlags.adoc[BCLog::LogFlags] log&lowbar;category = BCLog&colon;&colon;LogFlags&colon;&colon;ALL,
    bool msg&lowbar;on&lowbar;completion = true);
----

== Description

If log&lowbar;category is left as the default, end&lowbar;msg will log unconditionally (instead of being filtered by category)&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *prefix*
| Text prepended to every log line, usually the caller&apos;s function name&period;
| *end&lowbar;msg*
| Descriptive message of what is being timed, reused in the completion log&period;
| *log&lowbar;category*
| Category used to filter the completion log&semi; ALL logs unconditionally&period;
| *msg&lowbar;on&lowbar;completion*
| Whether to repeat end&lowbar;msg (rather than a plain &quot;completed&quot;) when the timer is destroyed&period;
|===


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