static string timeFormat = TIME; // 時刻の表示形式。 static void Main() { WriteHelp(); var cts = new CancellationTokenSource(); eventLoop = new KeyboardEventLoop(code => OnKeyDown(code, cts)); Task.WhenAll( eventLoop.Start(cts.Token), TimerLoop(cts.Token) ).Wait(); }