// High-performance background tasks
using System;
using System.Threading;
class Program
{
static Timer timer;
static void Main()
{
timer = new Timer(Tick, null, 0, 1000); // start immediately, tick every 1 sec
Console.WriteLine("Timer started. Press Enter to exit.");
Console.ReadLine();
}
static void Tick(object state)
{
Console.WriteLine("Tick: " + DateTime.Now);
}
}
/*
run:
Timer started. Press Enter to exit.
Tick: 04/13/2026 09:24:30
Tick: 04/13/2026 09:24:31
Tick: 04/13/2026 09:24:32
Tick: 04/13/2026 09:24:33
Tick: 04/13/2026 09:24:34
Tick: 04/13/2026 09:24:35
*/