Home  >  Article  >  Backend Development  >  c# timerCallback code introduction

c# timerCallback code introduction

黄舟
黄舟Original
2017-03-04 10:14:412265browse

Consider this scenario: you need to complete a certain task regularly (for example, regularly go to the remote server to fetch data, and regularly update a certain field in the database etc.), for this type of business, C# has also been encapsulated, which can help us complete it conveniently.

Code snippet:

Code description: new created a TimerCallBack class, and pass it a delegate to tell it what tasks to complete on a regular basis. New A TimerPass four parameters at the same time:

l ##Object that needs callback

l Parameters to be passed to the delegate, null means no parameters

##l How long to delay execution

l Executed every few seconds

# After

##New, execution begins.

The above is the content of the c# timerCallback code introduction. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn