FakeTimeProvider.CreateTimer Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
public:
override System::Threading::ITimer ^ CreateTimer(System::Threading::TimerCallback ^ callback, System::Object ^ state, TimeSpan dueTime, TimeSpan period);
public override System.Threading.ITimer CreateTimer (System.Threading.TimerCallback callback, object? state, TimeSpan dueTime, TimeSpan period);
override this.CreateTimer : System.Threading.TimerCallback * obj * TimeSpan * TimeSpan -> System.Threading.ITimer
Public Overrides Function CreateTimer (callback As TimerCallback, state As Object, dueTime As TimeSpan, period As TimeSpan) As ITimer
Parameters
- callback
- TimerCallback
A delegate representing a method to be executed when the timer fires. The method should be reentrant, as it may be invoked simultaneously on two threads if the timer fires again while a previous callback is still being handled.
- state
- Object
An object to be passed to the callback
. This may be null
.
- dueTime
- TimeSpan
The amount of time to delay before callback
is invoked. Specify InfiniteTimeSpan to prevent the timer from starting. Specify Zero to start the timer immediately.
- period
- TimeSpan
The time interval between invocations of callback
. Specify InfiniteTimeSpan to disable periodic signaling.
Returns
The newly created ITimer instance.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈