[SDL] Milliseconds on the Mac

Darrell Walisser dwaliss1 at purdue.edu
Sun Apr 30 10:09:03 PDT 2000


#include <Timer.h>

UnsignedWide time;

MicroSeconds (&time);

The low word of time variable is the number of milliseconds (with 20
microsecond error), since the computer has booted up. I am not sure what the
high word is for, but I assume it is rarely used.

so to get the microseconds, you do :

UInt32 microseconds = time.lo;

Keep in mind that MicroSeconds() is several times slower (I don't know
exactly) than LMGetTicks (), which is what SDL is using right now.

> From: Mike Powell <belar at earthling.net>
> Reply-To: sdl at lokigames.com
> Date: Sat, 29 Apr 2000 09:17:57 -0700
> To: sdl at lokigames.com
> Subject: Re: [SDL] Milliseconds on the Mac
> 
>> PPCs have a high-resolution timer which would be more adequate to the task.
>> I will toss you the source code once I boot up my Linux box.
> 
> Why do you need to boot up Linux to get at MacOS source? Or this
> source for PPC Linux? If so, it may not do me much good, unless you
> can tell me how to call the same routines from the MacOS.
> 
> ,---------------------------------------------------------.
> / _/_/_/    _/_/_/  _/        _/    _/_/   Michael Powell  /
> / _/    _/  _/      _/      _/  _/  _/  _/                 /
> / _/_/_/    _/_/    _/      _/_/_/  _/_/     Aspiring      /
> / _/    _/  _/      _/      _/  _/  _/  _/   Video Game    /
> / _/_/_/    _/_/_/  _/_/_/  _/  _/  _/  _/   Programmer    /
> `---------------------------------------------------------'
> 




More information about the SDL mailing list