using NoName;
using NoName.Timers;

class Program
{
public static void Main()
{
ExampleManageCls nm = new ExampleManageCls();
nm.running();
}
}

class ExampleManageCls
{
Timer tm = new Timer();
DateTime endTime;

public void running()
{
tm.Elapsed += new ElapsedEventHandler(____time_tick);
tm.Interval = 1000;
tm.Start();

endTime = DateTime.Now.AddMinutes(1);

while(true)
{
if(endTime<DateTime.Now)
{
break;
}
}
}

void ____time_tick(object sender, ElapsedEventArgs e)
{
Console.WriteLine(DateTime.Now.ToString() + "/" + endTime.ToString());
}
}

/*RESULT-------------------------------------------------------
2022-03-28 오전 9:56:47/2022-03-28 오전 9:57:13
2022-03-28 오전 9:56:48/2022-03-28 오전 9:57:13
2022-03-28 오전 9:56:49/2022-03-28 오전 9:57:13
2022-03-28 오전 9:56:50/2022-03-28 오전 9:57:13
2022-03-28 오전 9:56:51/2022-03-28 오전 9:57:13
2022-03-28 오전 9:56:52/2022-03-28 오전 9:57:13
2022-03-28 오전 9:56:53/2022-03-28 오전 9:57:13
2022-03-28 오전 9:56:54/2022-03-28 오전 9:57:13
2022-03-28 오전 9:56:55/2022-03-28 오전 9:57:13
2022-03-28 오전 9:56:56/2022-03-28 오전 9:57:13
2022-03-28 오전 9:56:57/2022-03-28 오전 9:57:13
2022-03-28 오전 9:56:58/2022-03-28 오전 9:57:13
2022-03-28 오전 9:56:59/2022-03-28 오전 9:57:13
2022-03-28 오전 9:57:00/2022-03-28 오전 9:57:13
2022-03-28 오전 9:57:01/2022-03-28 오전 9:57:13
2022-03-28 오전 9:57:02/2022-03-28 오전 9:57:13
2022-03-28 오전 9:57:03/2022-03-28 오전 9:57:13
2022-03-28 오전 9:57:04/2022-03-28 오전 9:57:13
2022-03-28 오전 9:57:05/2022-03-28 오전 9:57:13
2022-03-28 오전 9:57:06/2022-03-28 오전 9:57:13
2022-03-28 오전 9:57:07/2022-03-28 오전 9:57:13
2022-03-28 오전 9:57:08/2022-03-28 오전 9:57:13
2022-03-28 오전 9:57:09/2022-03-28 오전 9:57:13
2022-03-28 오전 9:57:10/2022-03-28 오전 9:57:13
2022-03-28 오전 9:57:11/2022-03-28 오전 9:57:13
2022-03-28 오전 9:57:12/2022-03-28 오전 9:57:13
2022-03-28 오전 9:57:13/2022-03-28 오전 9:57:13

D:\tmp\console>
-------------------------------------------------------*/

+ Recent posts