Hello friends, hope you all are enjoying good health and having good time. I got an excellent feedback about the last tutorial on How To Use Proteus ISIS & ARES & also got few queries and suggestions. One of them was to post a similar tutorial on the Eagle software as well which I will hopefully start in the coming week.
Today’s post is a very small trick but yet very effective one. In a recent project of mine, it helped me a lot and yet its quite a small thing but it took me around half an hour to find it online and that’s the reason I decided to share it with you guys.
What is a delay?
The engineers who had worked on Microcontrollers, they know that what is a delay.
- A delay in programming is a statement which adds a pause in your code.
For example, in some project you want to turn on two lights one after another with a delay of like 5 sec so now what will you do. You will first turn the first light on and then add a delay of 5 sec and then turn the second light on. That delay just let your code wait for 5 sec and then execute the next line.
Add a Delay in Microsoft Visual Studio 2010
In Microsoft Visual Studio, the command used for adding the delay is:
This command will generate a delay of 1sec. You can change this value in order to change the time of delay. i.e.
- 500 for 0.5 sec delay.
- 2000 for 2 sec delay.
- 5000 for 5 sec delay.
You need to calculate this value for your required delay and add it here.
- You should take much care in using this delay because this delay simply makes your software to sleep and thus while the delay is in process, your software won’t do any other task.
49,407 total views, 1 views today