home *** CD-ROM | disk | FTP | other *** search
- Path: cs.vu.nl!sun4nl!xs4all!marketgraph!rvg
- From: rvg@marketgraph.xs4all.nl (Ruud van Gaal)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Problem with clock() with SAS 6.3
- Message-ID: <2720obf60.alamito@marketgraph.xs4all.nl>
- Date: Thu, 1 Feb 96 14:32:39 CET
- References: <4ej4kh$nkf@bs33n.staffs.ac.uk>
- Reply-To: rvg@marketgraph.xs4all.nl
- X-Newsreader: Alamito Mail and News Manager (V2.0.4 for Waffle) registered to MARKETGRAPH VISUAL AUTOMATION
-
- In <4ej4kh$nkf@bs33n.staffs.ac.uk> cm4bctrd@bs47c.staffs.ac.uk (Wildfire)
- wrote:
-
- >But I'm getting screwy results.
- >Here's some sample code, and the output I get.
- >
- >#include <stdio.h>
- >#include <stdlib.h>
- >#include <time.h>
- >
- >int main()
- >{
- > unsigned int
- > loop;
- > clock_t time;
- > for( loop = 0 ; loop < 50 ; loop++ )
- > {
- > if( (clock_t) -1 == ( time = clock() ) )
- > {
- > printf( "%u. no time available.\n", loop );
- > } else printf( "%u. %d\n", loop, (int)time );
- > }
- > }
- >
- > return( EXIT_SUCCESS );
- >}
- >
- >And this is what I get...
- >
- >0. 2
- >1. 58
- >2. 134
- >3. 190
- >4. 262
- >5. 318
- >6. 395
- >7. 451
- >8. 4295491
- >9. 4295547
- >10. 4295619
- >11. 4295676
- >12. 4295748
- [..etc]
- >Anyways. Can anyone help! =-)
-
- Compiles & runs as expected on my SAS C >6.51<.
-
- --
- Ruud van Gaal
- MarketGraph Visual Automation
- E-Mail : rvg@marketgraph.xs4all.nl
- DoomShell 4.5 homepage: http://www.xs4all.nl/~jwkorver
- "...Works fascinates me. I could sit and watch it for hours..."
-
-