C# Class Utility.IntervalTask

计划任务辅助类
FileName: IntervalTask.cs CLRVersion: 4.0.30319.18444 Author: Devin DateTime: 2016/1/22 15:20:50 GitHub: https://github.com/v5bep7/Utility
Mostra file Open project: v5bep7/Utility Class Usage Examples

Public Methods

Method Description
GetTimer ( string markId ) : Timer

通过markId获取Timer对象

Start ( System.Action elapsed, int interval, bool autoReset = true ) : string

开始一个任务,返回一个标识该任务的markId

Stop ( string markId ) : void

通过MarkId停止任务

Method Details

GetTimer() public static method

通过markId获取Timer对象
public static GetTimer ( string markId ) : Timer
markId string
return Timer

Start() public static method

开始一个任务,返回一个标识该任务的markId
public static Start ( System.Action elapsed, int interval, bool autoReset = true ) : string
elapsed System.Action 需要执行的任务
interval int 执行的间隔时间.单位: 毫秒
autoReset bool 是否是周期性任务,还是一次性任务.默认是周期性任务
return string

Stop() public static method

通过MarkId停止任务
public static Stop ( string markId ) : void
markId string
return void