473,498 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what is funtion for delay in VC

hi
i need to insert delay in my program what function should i use
the old delay is not supported by the VC6

Nov 15 '05 #1
6 5528
In article <11**********************@f14g2000cwb.googlegroups .com>,
lucifer <um**********@gmail.com> wrote:
i need to insert delay in my program what function should i use
the old delay is not supported by the VC6


As you posted to comp.lang.c, our answer will be in terms of
the features provided by standardized C. Anything VC6 should
be discussed in a newsgroup appropriate for VC6.

Standard C provides no delay functions at all. None. Not one.
Zero. Zippo. Null set.

The closest you can get to a delay function in C is a loop that changes
the value of a volatile variable that has external linkage.

If you looped changing a local variable, there is the risk that the
optimizer would optimize the loop out completely, but for volatile
variables it should assume that there might be -some- other
mechanism that might change the value, so it shouldn't optimize
out the loop.

This is, of course, a very crude delay mechanism, and the duration
of the delay will likely vary from run to run, and if you have
multiple calls within the same program you shouldn't expect that they
would delay by the same duration.

If you want any kind of accuracy or repeatability or calibration
of a delay duration, you will need to use some implementation-
dependant call that is outside the scope of the C standard.
--
Goedel's Mail Filter Incompleteness Theorem:
In any sufficiently expressive language, with any fixed set of
email filtering algorithms, there exists at least one spam message
which the algorithms are unable to filter out.
Nov 15 '05 #2
you can use Sleep(int miliseconds) in VC++ , note the capital 'S'

Nov 15 '05 #3
"lucifer" <um**********@gmail.com> writes:
i need to insert delay in my program what function should i use
the old delay is not supported by the VC6


See question 19.37 in the C FAQ. It discusses delays with sub-second
resolution, but it's applicable to delays in general. Quick summary:
there's no portable way to do it, and we don't discuss non-portable
solutions here.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #4
Walter Roberson wrote:
In article <11**********************@f14g2000cwb.googlegroups .com>,
lucifer <um**********@gmail.com> wrote:
i need to insert delay in my program what function should i use
the old delay is not supported by the VC6


As you posted to comp.lang.c, our answer will be in terms of
the features provided by standardized C. Anything VC6 should
be discussed in a newsgroup appropriate for VC6.

Standard C provides no delay functions at all. None. Not one.
Zero. Zippo. Null set.

The closest you can get to a delay function in C is a loop that changes
the value of a volatile variable that has external linkage.


<snip>

You could also do a loop using the functions in time.h, although you
have no guarantee what precision you will get. Of course, I would not
want to use a program that made use of either of these methods so asking
in a microsoft group would indeed be the best course for the OP.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Nov 15 '05 #5
On 1 Oct 2005 10:01:50 -0700, in comp.lang.c , "Sandeep"
<sa************@gmail.com> wrote:
you can use Sleep(int miliseconds) in VC++ , note the capital 'S'


There's no function of that name in C. Please don't answer offtopic
questions in CLC.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Nov 15 '05 #6
lucifer wrote on 01/10/05 :
hi
i need to insert delay in my program what function should i use
the old delay is not supported by the VC6


There is no standard answer.

<OT>
Sleep() (include <windows.h>)
</>

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

I once asked an expert COBOL programmer, how to
declare local variables in COBOL, the reply was:
"what is a local variable?"
Nov 15 '05 #7

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

Similar topics

2
452
by: lucifer | last post by:
hi i need to insert delay in my program what function should i use the old delay is not supported by the standard C++
2
16288
by: amos_s12 | last post by:
Hello everybody Is there a possibility to make a delay between two sql statements, namely one sql statement is performed, then there is a delay of some seconds and then rhe next statement is...
11
21228
by: Maheshkumar.R | last post by:
Hi groups, How i can introduce some milliseconds delay in application. How i can do achieve this... let me clearly say... (1) I'm displaying slices of medical images. For framerate - for...
4
782
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I make a 10 second delay? ----------------------------------------------------------------------- There...
3
4340
by: Sirix42 | last post by:
Hi there, when I use Firefox to run my application (this involves sending an IFRAME request to the servlet and handling the response), there is no delay in displaying the data after each response....
1
1575
by: Neo007 | last post by:
What is different between SQL Funtion & SQL Stored Procedure? What the use Of Each? Where to use which?
1
6990
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...
1
2949
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...
0
7125
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,...
0
7004
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...
0
7167
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7208
jinu1996
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...
1
6890
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...
1
4915
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...
0
4593
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...
0
3095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
657
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.