I need to check a function every 60 seconds and do that with below code
void Application_Start(object sender, EventArgs e)
{
AddTask("CheckEmails", 60);
}
private void AddTask(string name, int seconds)
{
OnCacheRemove = new CacheItemRemovedCallback(CacheItemRemoved);
HttpRuntime.Cache.Insert(name, seconds, null, DateTime.Now.AddSeconds(seconds), Cache.NoSlidingExpiration,
CacheItemPriority.NotRemovable, OnCacheRemove);
}//addTask
public void CacheItemRemoved(string k, object v, CacheItemRemovedReason r)
{
//check for new emails
AddTask(k, Convert.ToInt32(v));
}//CacheItemRemoved