This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Timers; | |
using Timer = System.Timers.Timer; | |
namespace timetotime | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Timer t = new Timer(3000); // 1 sec = 1000, 60 sec = 60000 | |
t.AutoReset = true; | |
t.Elapsed += new System.Timers.ElapsedEventHandler(t_Elapsed); | |
t.Start(); | |
Console.ReadLine(); | |
} | |
private static void t_Elapsed(object sender, System.Timers.ElapsedEventArgs e) | |
{ | |
Console.WriteLine("1"); | |
Console.ReadLine(); | |
// do stuff every minute | |
} | |
} | |
} | |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using Timer = System.Timers.Timer;
namespace timetotime
{
class Program
{
static void Main(string[] args)
{
Timer t = new Timer(3000); // 1 sec = 1000, 60 sec = 60000
t.AutoReset = true;
t.Elapsed += new System.Timers.ElapsedEventHandler(t_Elapsed);
t.Start();
Console.ReadLine();
}
private static void t_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
Console.WriteLine("1");
Console.ReadLine();
// do stuff every minute
}
}
}
0 comments:
Post a Comment