[#BloombergLP-bdlmt-TimerEventScheduler-startClock]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlmt.adoc[bdlmt]::xref:BloombergLP/bdlmt/TimerEventScheduler.adoc[TimerEventScheduler]::startClock
:relfileprefix: ../../../
:mrdocs:

Schedule a recurring callback at the specified interval&period;

== Synopsis

Declared in `&lt;bdlmt&lowbar;timereventscheduler&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlmt/TimerEventScheduler/Handle.adoc[Handle]
startClock(
    xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] const& interval,
    xref:bsl/function-0a.adoc[bsl::function&lt;void()&gt;] const& callback,
    xref:BloombergLP/bsls/TimeInterval.adoc[bsls::TimeInterval] const& startTime = bsls&colon;&colon;TimeInterval(0));
----

== Description

Schedule a recurring event that invokes the specified `callback` at every specified `interval`, starting at the optionally specified `startTime`&period; On success, return a handle that can be use to cancel the clock (by invoking `cancelClock`), or return `e&lowbar;INVALID&lowbar;HANDLE` if scheduling this event would exceed the maximum number of scheduled events for this object (see constructor)&period; If no start time is specified, it is assumed to be the `interval` time from now&period; The `startTime` is an absolute time represented as an interval from some epoch, which is detemined by the clock indicated at construction (see &lsqb;&rsqb;Clock&hyphen;Types))&period;

== Return Value

a handle for the clock, or `e&lowbar;INVALID&lowbar;HANDLE` if the limit is exceeded

== Parameters

[cols="1,4"]
|===
| Name| Description
| *interval*
| period between recurring invocations
| *callback*
| function invoked at each interval
| *startTime*
| first invocation time&semi; the default is interval from now
|===


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