Ok, I made some changes and want to see what you guys think, as far as
syntax and logic, etc. What I want it to do is show the number of
minutes remaining each minute, and then beep at the end. Is there a
better way to do the loops?
using System;
using System.Threading;
class Timer
{
static void Main()
{
Console.Write("Enter the number of minutes to wait: ");
int iTime = Int32.Parse(Console.ReadLine());
for (int i = iDelay; i > 0; i--)
{
Console.WriteLine("{0} minute(s) remaining.", i);
Thread.Sleep(60000);
}
Console.Write("{0} minutes have elapsed", iTime);
for (int i = 3; i > 0; i--)
{
Console.Write("\a");
Thread.Sleep(1000);
}
} 2 1299
So, what's iDelay? And what exactly is the use of this application?
-vj
"John Salerno" <jo******@NOSPAMgmail.com> wrote in message
news:dP********************@rcn.net... Ok, I made some changes and want to see what you guys think, as far as syntax and logic, etc. What I want it to do is show the number of minutes remaining each minute, and then beep at the end. Is there a better way to do the loops? using System; using System.Threading;
class Timer { static void Main() { Console.Write("Enter the number of minutes to wait: "); int iTime = Int32.Parse(Console.ReadLine());
for (int i = iDelay; i > 0; i--) { Console.WriteLine("{0} minute(s) remaining.", i); Thread.Sleep(60000); }
Console.Write("{0} minutes have elapsed", iTime);
for (int i = 3; i > 0; i--) { Console.Write("\a"); Thread.Sleep(1000); } }
Vijaye Raji wrote: So, what's iDelay? And what exactly is the use of this application?
Sorry, iDelay should be iTime. The point of the program is just for me
to experiment with writing code a little, but it's also a little alarm I
wanted to make.
-vj "John Salerno" <jo******@NOSPAMgmail.com> wrote in message news:dP********************@rcn.net...
Ok, I made some changes and want to see what you guys think, as far as syntax and logic, etc. What I want it to do is show the number of minutes remaining each minute, and then beep at the end. Is there a better way to do the loops? using System; using System.Threading;
class Timer { static void Main() { Console.Write("Enter the number of minutes to wait: "); int iTime = Int32.Parse(Console.ReadLine());
for (int i = iDelay; i > 0; i--) { Console.WriteLine("{0} minute(s) remaining.", i); Thread.Sleep(60000); }
Console.Write("{0} minutes have elapsed", iTime);
for (int i = 3; i > 0; i--) { Console.Write("\a"); Thread.Sleep(1000); } } This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Djanvk |
last post by:
Ok I'm working on a program where you have say x number of seconds to
do something. I'm at a loss on how to go about running a timer
function. Can anyone point me in the right direction or post a...
|
by: martinm69x |
last post by:
Hey all,
I've been working on the code for a kernel timer which will report real
time, CPU time, user time and kernel time on the operation of fibonacci
method.
The way im doing it is keeping...
|
by: sm |
last post by:
Hi All,
I need to do a task at 3pm everyday. How do I set up the timer so that the
timer procedure executes at 3pm everyday? Is there any other solution other
than using a timer?
Thanks.
|
by: 180Reef |
last post by:
I am new to using timers and am not sure which timer is best used for
the timer driven vb program described below. Also, if I should use one
master timer or a timer for each button (system resource...
|
by: Greg |
last post by:
I am building an SVG interface (with Javascript) for client side control
of some hardware. The svg will be hosted on a micro PC
(http://www.picotux.com/indexe.html). It runs a uClinux OS with GCC...
| |
by: Lemune |
last post by:
Hello everyone.
I'm using vb 2005. I'm creating program that run as service on windows.
And in my program I need to use timer, so I'm using timer object from
component. I try my source code on...
|
by: RobKinney1 |
last post by:
Hello,
Wow...I have one for you all and hopefully I am not understanding this timer
object correctly. I have a timer setup that pulses a connection through a
socket every 60 seconds. But it...
|
by: archana |
last post by:
Hi all,
I want to know about interval of timer.
I am using timer in windows service.I head somewhere that when i set
interval property of timer while setting interval, restart time of Pc
is...
|
by: Joris De Groote |
last post by:
Hi,
I have wrote a program that checks for files and moves these files to the
correct folders when they come in. Everything works fine. However I always
have to start that program manually. I...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |