473,805 Members | 2,278 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to write a time delay function?

Hello,
I want to write a time delay function like "Timedelay(floa t time_lenth){}".
When execute it, it will delay some seconds as long as "time_lenth "
indicating. Could you help on how to write such a function?

----------------
lovely newsgroup
----------------
Sep 8 '06
24 16141
John F wrote:
Mark McIntyre wrote:
.... snip ...
>
>but thats why we don't ask or answer system-specific
questions here.

*gg* I know. But if you know better, why not correct it?
Did you never make a mistake, or even a typo? The point is that
the experts on that foreign system are not here, they are on some
other newsgroup. So there is nobody available to point out your
errors, if any. Thus the only sane thing to do is to redirect the
user to the appropriate newsgroup.

--
"The smaller aperture of the lid has been designed to prevent
hedgehogs from entering the McFlurry container in the
unfortunate incidence that the lid is littered"
-- McDonalds, as quoted in Time, 2006-09-11
--
Posted via a free Usenet account from http://www.teranews.com

Sep 9 '06 #21
Keith Thompson wrote:
"John F" <sp**@127.0.0.1 writes:
>Mark McIntyre wrote:
>>On Fri, 8 Sep 2006 15:57:18 +0200, in comp.lang.c , "John F"
<sp**@127.0.0 .1wrote:
The things to look for are SetTimer and KillTimer...

Euh, no.

Why not? :-) It can be done. BTDT. It is as portable and
standardized
as any way to achieve this...
>>but thats why we don't ask or answer system-specific
questions here.

*gg* I know. But if you know better, why not correct it?
[snip]

Because this isn't the place for it.
He started the fire, not me :-) I just wanted to know why he judged it
"Euh, no".
Assuming SetTimer and KillTimer are specific to MS Windows, there
are
a number of Windows-specific newsgroups full of people who know all
about this stuff. comp.lang.c, on the other hand, is constantly
inundated with off-topic posts; carring on off-topic technical
discussions here would only make it worse, and make things more
difficult for those of us who want to talk about C.
I know the "agenda" of this group.
I just gave a pointer on what he might have a closer look at while
trying to find his way through the (almost) endless fields of the
Windows API :-).

Recently in the thread on accessing the serial port from XP there was
one post on topic to the thread (maybe 2 or 3, don't remember), ~30
complaining that the thread as a whole was not on topic, ~30 about the
response was not on topic or 100% correct (whereas IMHO it was legal
and correct) or that the response to the response....

BTW.:
There are dedicated off-topic NGs (borland.public .off-topic) where a
lot of fun is happening. You should have a look at it. It's moderated
and thus free of spam or rude/hateful stuff.

--
Johannes
You can have it:
Quick, Accurate, Inexpensive.
Pick two.
Sep 9 '06 #22
CBFalconer wrote:
John F wrote:
>Mark McIntyre wrote:
... snip ...
>>
>>but thats why we don't ask or answer system-specific
questions here.

*gg* I know. But if you know better, why not correct it?

Did you never make a mistake, or even a typo?
Frequently but hardly ever on important stuff. I'm just too careful on
that. Communicating reliable information is not straight forward so I
double check before I actually post something.
The point is that
the experts on that foreign system are not here, they are on some
other newsgroup.
Maybe some are here too, "incognito" .
So there is nobody available to point out your
errors, if any.
It was in reply to his
Euh, no.
So I expected him to know something I don't know on that topic (which
may well be true, since I don't know everything).
I just gave some keywords the OP could have a look at, which are on
topic to the subject of this thread.
Thus the only sane thing to do is to redirect the
user to the appropriate newsgroup.

Yes. Has been done. I added keywords for the OP to dig into the
subjecto of timing under windows.

--
Johannes
You can have it:
Quick, Accurate, Inexpensive.
Pick two.
Sep 9 '06 #23
On Sat, 9 Sep 2006 05:36:41 +0200, in comp.lang.c , "John F"
<sp**@127.0.0.1 wrote:
>He started the fire, not me :-) I just wanted to know why he judged it
"Euh, no".
Because its not the way to do what he asked for, but explaining about
it is offtopic here.
>I know the "agenda" of this group.
You put agenda in quotes, like it was something sinister. The only
possible reason for you to do that is becahse you are being
deliberately disingenuous.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Sep 10 '06 #24
Mark McIntyre wrote:
On Sat, 9 Sep 2006 05:36:41 +0200, in comp.lang.c , "John F"
<sp**@127.0.0.1 wrote:
>He started the fire, not me :-) I just wanted to know why he judged
it "Euh, no".

Because its not the way to do what he asked for, but explaining
about
it is offtopic here.
It can be done that way.
>I know the "agenda" of this group.

You put agenda in quotes, like it was something sinister. The only
possible reason for you to do that is becahse you are being
deliberately disingenuous.
Um. Maybe :-). I actually like c.l.c.. I still happen to notice the
redundancy of off-topic-calls and even the leagl answers. Bashing on
off-topic stuff shouldn't be stressed that much.

--
Johannes
You can have it:
Quick, Accurate, Inexpensive.
Pick two.
Sep 11 '06 #25

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
14870
by: gmv | last post by:
Hi, I am doing a project and i would like to know if anyone can please tell me how to write a delay or wait function in c++ which works asynchronously with other programs. Thank you, GMV
2
3680
by: notregister | last post by:
I'm to delay my program for some limited time...i try using the following codes but it doesn't work, how do i do a time delay??? 'Extracted from the main function Timer11.Start() Do tCC = timeCount Loop Until timeCount > 10000
0
1156
by: jayasakthi | last post by:
when we freeze the columns of a table in jsp, there is a time delay in scrolling the page. when we unlock the columns the time delay is not there. is there any solution for decreasing the time delay without locking the columns.
1
3685
by: klmishraa79 | last post by:
i want to know how i can put a time delay between two command execution...i.e. after first command of programm the second command should execute after some fixed delay......i want to use time delay other than sleep or timer....is it there any direct delay command like it is in c and c+...looking for ur suggestions.....thanks
9
2272
by: Martin Wells | last post by:
I'm doing an embedded systems project and I'm programming it as fully- portable C89 (except of course for setting the pin values). I need to put delays in the program, in the vicinity of 250 ms. (They don't need to be exact). Does C have a built-in method of putting in delays? If not, I was thinking of defining a macro called "FLOPS" (i.e. floating-point operations per second) and then doing something like:
1
7010
by: maul581 | last post by:
I know the delay( ) function of Turbo C and used it in my project. By this function we can give intermediate delay in execution from 1 millisecond to 9999 millisecond. My main question is "Is it possible to get delay less than 1 millisecond in Turbo C"? If by changin any header file (e.g. dos.h) or by creating my own "delay" function, at any way Can I get delay less than 1 millisecond? If in C it is not possible than please suggest me any...
3
22368
Ali Rizwan
by: Ali Rizwan | last post by:
Hello all, I want to put delay in my loops as we use in c/c++.. Is there any delay function in vb6 which put delay between any code??? Thanx >> ALI <<
2
5118
by: Rahina | last post by:
I am working in Dreamweaver 8, and I have created a simple form: http://www.realmofmystery.com/app.html This is a free website I am doing for some friends, so nothing fancy. And, I learned web design before all the CGI and PHP stuff got big, so I prefer to do things simply. The form worked fine, emails the results like perfect, but it refused to redirect the page to the confirmation. I thought I could add an onClick to the submit button,...
8
4239
by: Craig Williamson | last post by:
I'm trying to write a time delay loop in Borland C 3.1 (for legacy code) which has an accuracy of about 0.1ms. This change is due to a hardware change and the software is now running too fast to take proper readings. I have been using delay(1) in the past but it does not have the accuracy that I need for this situation. Does anyone know of a useful C function which can be used to create the time delay? If anyone could help that would...
0
9718
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10369
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9186
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4327
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 we have to send another system
2
3847
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.