Article View: comp.sys.amiga.tech
Article #8462Re: Frienndly Sleep (not hogging the CPU)
From: Richard A Thomson
Date: Mon, 11 Apr 1988 06:24
Date: Mon, 11 Apr 1988 06:24
24 lines
1134 bytes
1134 bytes
In article <662@wolf.UUCP> uzun@wolf.UUCP (Roger Uzun) writes: > I was wondering if there was a friendly way for an amiga Process to >Sleep for a period of time (in C). Currently to sleep for say, >1 second I do a > >for(i=0;i<50;i++) > WaitTOF(); > >Is there a better, possibly more precise way of waiting for a period >of time without hogging the CPU. > >Thanks >-Roger There is a DOS routine called Delay() that does exactly what you want. Use the form: Delay(ticks); /* there are 50 ticks per second */ So to get a delay of 1 second, you would use: Delay(50); -- Rich Thomson
Technical Details
Message-ID:
<5405@utah-cs.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!faline!thumper!ulysses!gamma!mibte!fmsrl7!eecae!nancy!mailrus!tut.cis.ohio-state.edu!im4u!ut-sally!utah-cs!thomsonReferences:
<662@wolf.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!faline!thumper!ulysses!gamma!mibte!fmsrl7!eecae!nancy!mailrus!tut.cis.ohio-state.edu!im4u!ut-sally!utah-cs!thomson From: thomson@utah-cs.UUCP (Richard A Thomson) Newsgroups: comp.sys.amiga.tech Subject: Re: Frienndly Sleep (not hogging the CPU) Keywords: Sleep Message-ID: <5405@utah-cs.UUCP> Date: 11 Apr 88 06:24:54 GMT References: <662@wolf.UUCP> Reply-To: thomson@cs.utah.edu.UUCP (Richard A Thomson) Organization: University of Utah CS Dept Lines: 24