If your clock error is x% then you can only sleep
(100-x)%. I picked the half-way point because it's easy to visualize
the methodology, but 90% or even 99% is sure to work (just don't try
99.999%).
> >I have a radio-broadcast-over-internet project I'm
> >working on and it requires 1/2 second resolution.
>
> Resolution or accuracy? You may have problem guaranteeing this kind of
> accuracy with a REXX app if there are any other processes active.
Actually, both in different parts of the systems. For each hour I'm
counting the number of data points in the transmission to make sure I'm
transmitting exactly one hour of audio.
As a side comment, remember how Jerry Rash was complaining a while back
that his video captures would all of a sudden dump, or the Z! audio
complaints that audio-over-internet would suddenly die? I can't speak
for every instance of this but when the transmitting clock is slightly
different from the receiving clock you'll get a buffer underrun or
overrun causing a major whammy in your received data stream. Suppose
you have 100 radio listeners; the ones whose audio card clocks are
closest to the server's audio clock frequency will "stay on the
broadcast" the longest, while those with larger errors will suffer the
buffer under/over-run condition sooner.
> Of course, since SysSleep() is limited to a 1 second resolution
Hmm. Your code snippet shows that SysSleep() doesn't support partial
seconds but I just retested my software and SysSleep() will accept a
fractional portion of a second (i.e. SysSleep(1.5)) _and_ will sleep for
partial seconds.
Here's my test, using my waitsec.cmd which uses SysSleep():
[G:\]waitsec 1 & waitsec 1 & waitsec 1 & waitsec 1 & waitsec 1
[G:\]waitsec 1.5 & waitsec 1.5 & waitsec 1.5 & waitsec 1.5 & waitsec 1.5
[G:\]waitsec 2 & waitsec 2 & waitsec 2 & waitsec 2 & waitsec 2
The three command lines took 5 seconds, 7.5 seconds and 10 seconds to
execute.
Here is the relevant code from my waitsec.cmd:
parse arg Seconds Options
...
call SysSleep Seconds
Hmm. Your toolkit and my SysSleep() don't seem to match.
- Peter
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-programming".
For problems, contact the list owner at
"postmaster@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 12 |
September |
2006 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.