delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/02/01/17:40:16

From: "Rich B" <webmaster AT greenapple DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: newbie: countdown timer
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Message-ID: <15Hl4.1587$Dw2.6114@news>
Date: Tue, 01 Feb 2000 20:10:37 GMT
NNTP-Posting-Host: 198.144.72.138
X-Trace: news 949435837 198.144.72.138 (Tue, 01 Feb 2000 15:10:37 EST)
NNTP-Posting-Date: Tue, 01 Feb 2000 15:10:37 EST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I've set up a Win98 machine to run network status utilities to monitor
various pieces of equipment on my ISP's LAN/WAN. This machine is running
several services, such a IPSwitch's WhatsUp montior, Apache 1.3.9 (for live
retrieval of logs) and several PERL scripts that use SNMP to monitor traffic
through switches, routers, and RAS equipment.

To facilitate managing this hodge-podge of various scripts and formating the
HTML output, I've used djgpp to write a program that runs an infinite while
loop with a sleep timer of 600 (10 minutes). The problem I'm having though
is that the machine doesn't really "do" anything while the program I've
written is sleeping:

printf("(sleeping)\n");
sleep(600);

I've got enough knowledge of C to get what I want done, but I'm pretty
clueless on how to make this program more user friendly, like outputting a
countdown timer to the terminal. I'd like the program to output a timer
(starting at 10:00), which counts down the minutes:seconds until the loop
runs again. This script doesn't need to be portable, and the machine this
program runs on is secured, so system calls are fine.

Any help for this newbie would be appreciated. :-)

Rich B



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019