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

Test helper that substitutes a controllable clock into a timer scheduler&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class TimerEventSchedulerTestTimeSource;
----

== Description

This class provides a means to change the clock that is used by a given event&hyphen;scheduler to determine when events should be triggered&period; Constructing a `TimerEventSchedulerTestTimeSource` alters the behavior of the supplied event&hyphen;scheduler&period; After a test time&hyphen;source is created, the underlying scheduler will run events according to a discrete timeline, whose successive values are determined by calls to `advanceTime` on the test time&hyphen;source, and can be retrieved by calling `now` on that test time&hyphen;source&period; Note that the &quot;system&hyphen;time&quot; held by a test time&hyphen;source _does_ _not_ correspond to the current system time&period; Test writers must use caution when scheduling absolute&hyphen;time events so that they are scheduled relative to the test time&hyphen;source&apos;s value for `now`&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlmt/TimerEventSchedulerTestTimeSource/2constructor.adoc[`TimerEventSchedulerTestTimeSource`]         [.small]#[constructor]#
| Construct a test time&hyphen;source that controls the given scheduler&apos;s clock&period;
| xref:BloombergLP/bdlmt/TimerEventSchedulerTestTimeSource/advanceTime.adoc[`advanceTime`] 
| Advance this object&apos;s current time by the specified amount&period;
| xref:BloombergLP/bdlmt/TimerEventSchedulerTestTimeSource/now.adoc[`now`] 
| Return this object&apos;s current test&hyphen;time value&period;
|===



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