473,327 Members | 2,025 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Timers to take msg

58
Hi all,

I newbe for using a timers.
my requirement is when i enter a message name like " start " ,If it doesn't start in the particular time e.g in 20 seconds then it show the a dilaog box or any printf like start function is not start.

please help me i need your help..........

really any type suggestion is appricited..

thank you..

-Raju
Dec 19 '06 #1
1 1373
this is a function for a timer:

Expand|Select|Wrap|Line Numbers
  1. void sleep(unsigned int mseconds){
  2.      clock_t goal = mseconds + clock();
  3.      while (goal > clock());
  4. }
usage:

Expand|Select|Wrap|Line Numbers
  1. printf("The program is now waiting 5 seconds and will start the program after");
  2. sleep(5000)
  3. startprogram();
  4.  
  5. if (variable == 1){
  6.   printf("It started");
  7. }else{
  8.   printf("It hasn't started");
  9. }
  10.  
  11. // get something in the function startprogram() to set a variable to 1
  12. // 5000 is the milliseconds the program waits so 5000 = 5 seconds.
// when sleep is running you can't do anything else!

I don't know if that's what you actually meant, maybe you should try it out.
Dec 19 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: User | last post by:
Hi, What is the best way to release all resources holded by the Timer (myTimer from class System.Timers.Timer)? Is it: 1- myTimer.dispose 2- myTimer.enabled = false 3- myTimer.close
9
by: Mark Rae | last post by:
Hi, I've seen several articles about using System Timers in ASP.NET solutions, specifically setting them up in Global.asax' Application_OnStart event. I'm thinking about the scenario where I...
6
by: Gene Hubert | last post by:
I seem to be getting crazy results when I have multiple System.Windows.Forms.Timer objects in the same form running at the same time. When only one timer is running I get the expected behavior. ...
2
by: cntams | last post by:
All, I have a Windows Service and it has one System.Timers.Timer that fires every 500 milliseconds. Now I have noticed that there's a bug in System.Timers.Timer when it's being used combined with...
5
by: Tony Gravagno | last post by:
I have a class that instantiates two Timer objects that fire at different intervals. My class can be instantiated within a Windows Form or from a Windows Service. Actions performed by one of the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.