473,406 Members | 2,633 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,406 software developers and data experts.

Timer functions for DOS box program?

I have a program written in C that needs a way to run a function every
second or two (resolution 100 mS). The program is a console program.
What I would like is likely a DOS API that allows a sleep for a
period of time so that other operations on the computer are not
disturbed. I have looked through a few books, the web, and news
groups, but have not found a solution. I recall a number of DOS
programs, such as games and terminal programs, that used similar
functionality. Any suggestions?

Portability is not a big issue in that it is a DOS program always, but
that said, there may be differences between the versions of DOS and
Windows that will need to be tested in code.
--
e-mail: d boland 9 (all 1 word) at fastmail period fm
Sep 6 '07 #1
2 1722
Dave <no****@nospam.comwrites:
I have a program written in C that needs a way to run a function every
second or two (resolution 100 mS). The program is a console
program. What I would like is likely a DOS API that allows a sleep for
a period of time so that other operations on the computer are not
disturbed. I have looked through a few books, the web, and news
groups, but have not found a solution. I recall a number of DOS
programs, such as games and terminal programs, that used similar
functionality. Any suggestions?

Portability is not a big issue in that it is a DOS program always, but
that said, there may be differences between the versions of DOS and
Windows that will need to be tested in code.
Standard C has no good way to do this. You said you're looking for a
DOS API; you'll have better luck finding it in a system-specific
newsgroup.

comp.os.msdos.programmer *might* be the best place to ask, but that's
based only on the name of the group. Take a look at the existing
articles first, and find out if they have an FAQ list.

--
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."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Sep 6 '07 #2
Keith Thompson <ks***@mib.orgwrote in
news:ln************@nuthaus.mib.org:
comp.os.msdos.programmer *might* be the best place to ask, but that's
based only on the name of the group. Take a look at the existing
articles first, and find out if they have an FAQ list.
At one time that was a very active group, but not any more. MS has lots of
public news groups available. Set you're news reader to server:
msnews.microsoft.com

Sep 7 '07 #3

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

Similar topics

8
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...
8
by: bearophileHUGS | last post by:
Hello, I have four things to ask or to suggest, sorry if they seem basic or already discussed. ------------------- I am still ignorant about Tkinter. This little program, after pressing the...
1
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...
6
by: paresh | last post by:
Hi all, I need to set timer in C/linux like alram, such that i will get a timeout signal after specific timeout and my process remain executing as is it. I can use signal(SIGALRM, xyz) and then...
19
by: UG | last post by:
I just wanted to know whether any timer facility exists in C, as it is not mentioned in K&R 2, or in the ISO Draft. By timer function i mean that when we use standard input function like scanf() or...
10
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...
7
by: Daniele Piccinini | last post by:
Hallo, I've writed a C# windows service in VS 2003. This service use a System.Timers.Timer to periodically call some functions of a web service. ( Some of this functions required minutes to be...
7
by: Andrew Wan | last post by:
I found this excellent High Speed Timer (in Pascal). I compiled it (using Turbo Pascal 7 and it runs fine): http://www.sorucevap.com/bilisimteknolojisi/programcilik/pascal/ders.asp?207995 and...
19
by: colin | last post by:
Hi, Im trying to time some parts of my code using the Stopwatch class, but it is so slow, I tried the QueryPerformanceFrequency() but this seems to be just as slow, if I just simply call this...
14
by: Alexander Mahone | last post by:
Hello, I need a facility in C, like a set of functions, to manage a timer: I should be able to initialize it with a certain period of time (like x msec), start it, and every x msec it should...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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...
0
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...
0
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,...
0
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...

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.