🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #12679

Re: Sleep( ) differences in Win98 and WinXP?

#12679
From: Bob Gonder
Date: Thu, 20 Nov 2003 18:45
16 lines
1931 bytes
Nicholas Gessler wrote:

>So I need a way to adjust these intervals smoothly in 
>the range of 1-10 ms.  I'm guessing that the Timer Component
>cannot slice time that precisely.

What baud rate are you using?
I think if you wrote the proper number of zeros, you could get a
fairly accurate delay.

Let's say your rate is 153,600.  At that rate, the com port is sending
15,360 chars per second (1 start, 8 data, 1 stop bit per char).  If
you want to send 1000 commands per second, you need to send the
command every 153.6 characters.
So, if the command is 3 characters, adding 150.6 (maybe 151) zeros to
the end of the command will space out your data to approx 1ms.
Technical Details
Message-ID: <g72qrvcdgah8oeasadanmcdqa514n1ftuk@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!rip!news.webusenet.com!peer01.cox.net!cox.net!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3fbc4093$1@newsgroups.borland.com> <3fbc4bcd$1@newsgroups.borland.com> <3fbc4e30@newsgroups.borland.com> <3fbc537f$1@newsgroups.borland.com> <3fbc5a0b$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,a735156abe5db193
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-11-20 10:47:27 PST
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Sleep( ) differences in Win98 and WinXP? 
Date: Thu, 20 Nov 2003 10:45:14 -0800
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <g72qrvcdgah8oeasadanmcdqa514n1ftuk@4ax.com>
References: <3fbc4093$1@newsgroups.borland.com> <3fbc4bcd$1@newsgroups.borland.com> <3fbc4e30@newsgroups.borland.com> <3fbc537f$1@newsgroups.borland.com> <3fbc5a0b$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.31.164.227
X-Trace: newsgroups.borland.com 1069353916 67.31.164.227 (20 Nov 2003 10:45:16 -0700)
Lines: 18
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!rip!news.webusenet.com!peer01.cox.net!cox.net!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail