This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var task = Task.Factory.StartNew(() => | |
{ | |
//time consuming task | |
}); | |
task.ContinueWith((t) => | |
{ | |
//TODO when task finishes | |
}, TaskContinuationOptions.ExecuteSynchronously); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.Threading.Timer timer = null; | |
timer = new System.Threading.Timer((obj) => | |
{ | |
//Delayed Code here | |
timer.Dispose(); | |
}, | |
null, 3000 /*Delay time in ms*/, System.Threading.Timeout.Infinite); |