Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] C# - Delays using Console

Status
Not open for further replies.

atferrari

Full Member level 4
Joined
Jun 29, 2004
Messages
237
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Location
Buenos Aires - Argentina
Activity points
1,996
C# - Using Console.

I need to implement delays between actions.

They should happen once or be asigned to repetitive actions.

I identified Threading.Timer and Timers.Timer already but I can not find how they should be used.

Could anyone explain how, showing a sample of code?

Gracias.
 

you can use this code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading; //you must write this line

namespace Delay
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("My Name Is:");
Thread.Sleep(1000); //delay of 1000 milliseconds or 1 second.
Console.WriteLine("Mohsen Yazdani");
}
}
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top