473,790 Members | 3,200 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 5564
In article <11************ **********@f14g 2000cwb.googleg roups.com>,
lucifer <um**********@g mail.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**********@g mail.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_Keit h) 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************ **********@f14g 2000cwb.googleg roups.com>,
lucifer <um**********@g mail.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
16401
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 performed. In sybase database, there is a possibility to do such thing by using the statement waitfor delay 'hh:mm:dd' for example: while(...)
11
21256
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 this i'm loading 2+ slices, 4+ slices in loop to have cine impact..-> Ok working (2) But if i want to reduce the speed...how i can introduce delay inbetween
4
782
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I make a 10 second delay? ----------------------------------------------------------------------- There is no built-in way to pause execution in javascript such as a sleep function, but hosts usually provide a method of some form. Web browsers are designed for event driven programming and only provide the « setTimeout » and « setInterval »...
3
4360
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. But when I use IE, there seems to be a 1-2 second delay. The script sends a request using IFrame, goes through a loop to return script tags containing data to the browser, and then data is displayed by the browser and a new request is sent. For...
1
1589
by: Neo007 | last post by:
What is different between SQL Funtion & SQL Stored Procedure? What the use Of Each? Where to use which?
1
7008
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...
1
2974
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...
0
9666
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
9512
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,...
0
10201
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9987
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9023
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
7531
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
6770
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();...
0
5424
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4100
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

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.