Article View: comp.lang.modula2
Article #1819Re: timing programs with Metrowerks Mod 2 on Macs
From: Chuck Lins
Date: Wed, 20 Mar 1991 23:38
Date: Wed, 20 Mar 1991 23:38
31 lines
1900 bytes
1900 bytes
In article <66570@eerie.acsu.Buffalo.EDU> curtis@sybil.cs.Buffalo.EDU (Ronald Curtis) writes:
>Does anyone know a way to time programs using the Student version of
>Metrowerks Mac Mod2? That is, does anyone have a procedure "gettime" so that
>students can determine the time used by their program? eg
>
> x := gettime
> code to be timed goes here
> y := gettime
> timeused := y-x
>
>The goal is to have them develop two implementation modules for a single
>def and compare the results analytically and experimentally.
>
>--
>* Ronald Curtis, Computer Science Dept., SUNY at Buffalo, Buffalo, NY 14260 *
>* OFFICE: 235 Bell Hall TELEPHONE: (716) 636-3185 CSNET: curtis@buffalo.csnet *
>* BITNET: curtis%cs.buffalo.edu@ubvm.bitnet UUCP: {apple, cornell,decwrl, *
>* harvard,rutgers,talcott,ucbvax,uunet}!cs.buffalo.edu!curtis *
Use the Toolbox routine "TickCount" - it's in the Utilities module. Gives results
to 1/60th of a second. If you need better accuracy you'll have ti use a milli-
second timer using the Time Manager described in Inside Macinotsh Volume 4.
--
Chuck Lins | "Is this the kind of work you'd like to do?"
Apple Computer, Inc. | -- Front 242
20525 Mariani Avenue | Internet: lins@apple.com
Mail Stop 37-BD | AppleLink: LINS@applelink.apple.com
Cupertino, CA 95014 | "Self-proclaimed Object Oberon Evangelist"
The intersection of Apple's ideas and my ideas yields the empty set.
Technical Details
Message-ID:
<50554@apple.Apple.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!linsReferences:
<66570@eerie.acsu.Buffalo.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!lins From: lins@Apple.COM (Chuck Lins) Newsgroups: comp.lang.modula2 Subject: Re: timing programs with Metrowerks Mod 2 on Macs Summary: Use TickCount Message-ID: <50554@apple.Apple.COM> Date: 20 Mar 91 23:38:36 GMT References: <66570@eerie.acsu.Buffalo.EDU> Distribution: na Organization: Apple Computer Inc., Cupertino, CA Lines: 31