Thread View: comp.sys.mac.programmer.help
5 messages
5 total messages
Started by Bill A. Oyler
Mon, 21 Aug 1995 05:03
Pausing program for specified # of seconds in THINK C
Author: Bill A. Oyler
Date: Mon, 21 Aug 1995 05:03
Date: Mon, 21 Aug 1995 05:03
13 lines
880 bytes
880 bytes
Hello, Is there a toolbox command I can use to "pause" my program for the desired number of seconds (or ticks, if necessary)? All I need to do is pause for about 4 seconds while a splash screen is displayed... Thanks! ===================================================== Bill A. Oyler People usually get what's Minnetonka, MN, USA coming to them ... unless oylerb@tdkt.skypoint.net it's been mailed. =====================================================
Re: Pausing program for specified # of seconds in THINK C
Author: Martin Adler
Date: Mon, 21 Aug 1995 11:38
Date: Mon, 21 Aug 1995 11:38
31 lines
1180 bytes
1180 bytes
In article <oylerb-2108950003230001@msp1-5.nas.mr.net>, oylerb@tdkt.skypoint.net (Bill A. Oyler) wrote: > Hello, > > Is there a toolbox command I can use to "pause" my program for the desired > number of seconds (or ticks, if necessary)? All I need to do is pause for > about 4 seconds while a splash screen is displayed... > > Thanks! there is a toolbox-routine: # include <OSUtils.h> ... Delay (ticks,&finalTicks); /* in ticks should be the desired duration of the delay in 1/60-seconds, so 240 should be approx. 4 seconds in finalTicks you get back the system-time since start up on return, (i think you don't need this) */ ... Gulpi = Martin Adler
Re: Pausing program for specified # of seconds in THINK C
Author: F. Degott
Date: Mon, 21 Aug 1995 11:55
Date: Mon, 21 Aug 1995 11:55
29 lines
1374 bytes
1374 bytes
In article <oylerb-2108950003230001@msp1-5.nas.mr.net>, oylerb@tdkt.skypoint.net (Bill A. Oyler) wrote: >Hello, > >Is there a toolbox command I can use to "pause" my program for the desired >number of seconds (or ticks, if necessary)? All I need to do is pause for >about 4 seconds while a splash screen is displayed... > >Thanks! > Hi Bill, there is a proc. called Delay (OS Utilities) PROCEDURE Delay (numTicks: LONGINT; VAR finalTicks: LONGINT); numTicks describe the time to delay in 1/60 sec. to pause your program for 4 seconds: Delay(240,fTicks); Hope this helps. Fr ------------------------------------------------------------------------- FR Degott (Francois-Regis.Degott@imag.fr) Lab. LMC-IMAG - UJF - Grenoble - France -------------------------------------------------------------------------
Re: Pausing program for specified # of seconds in THINK C
Author: Derick J.R. Qua-Gonzalez
Date: Mon, 21 Aug 1995 12:20
Date: Mon, 21 Aug 1995 12:20
22 lines
1454 bytes
1454 bytes
oylerb@tdkt.skypoint.net (Bill A. Oyler) writes: >Is there a toolbox command I can use to "pause" my program for the desired >number of seconds (or ticks, if necessary)? All I need to do is pause for >about 4 seconds while a splash screen is displayed... toolbox? What's that? Try the sleep function if you have it, or a loop that gets the time repeatedly until four seconds have expired (may do something short in the interim). Best regards, Derick. -- +-----------------------------------------------------------------------------+ | Derick R. Qua-Gonzalez | ________ | | Department of High Energy Physics, California State University | \ / | | dqua@dqua.EarthLink.Net | \ / | | ``It is better to be hated for what one is, | \ / | | than loved for what one is not.'' (A. Gide) | G \/ USA| +------------------------------------------------------------------+----------+
Re: Pausing program for specified # of seconds in THINK C
Author: Scott A. Johnson
Date: Fri, 25 Aug 1995 14:15
Date: Fri, 25 Aug 1995 14:15
25 lines
1317 bytes
1317 bytes
In article <oylerb-2108950003230001@msp1-5.nas.mr.net>,
oylerb@tdkt.skypoint.net (Bill A. Oyler) wrote:
> Is there a toolbox command I can use to "pause" my program for the desired
> number of seconds (or ticks, if necessary)? All I need to do is pause for
> about 4 seconds while a splash screen is displayed...
Yes, the call you're looking for is Delay and takes two parameters, e.g.:
// do stuff
Delay( kFourSecondsInTicks, &finalTicks );
// continue doing stuff
The first parameter is how long you want to delay (yes, in ticks).
The second is the address of a long into which the system will return
how many ticks have gone by from system startup to the end of
the delay.
The delay call may or may not "pause" exacty the number of ticks
you specify but it usually won't be off by more than 1 tick.
Hope this helps,
Scott
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads