OneCompiler

one second delay

whats wrong with this c# code to create a one second delay?

using System;
using System.Diagnostics;
using System.Threading;
class Program
{
/* notes
Thread.Sleep(time);
*/
static void Main(string[] args)
{
Console.WriteLine("tTt");
Thread.Sleep(10000);
Console.WriteLine("fFf");
/string clear = "clear";
Console.WriteLine("clear");
/
}
}

1 Answer

4 years ago by

Please change
Thread.Sleep(10000);
to
Thread.Sleep(1000);

10 seonds sleep will fail in OneCompiler as the program will timeout

4 years ago by Karthik Divi