MUD-Dev
mailing list archive
[ Other Periods
| Other mailing lists
| Search
]
Date:
[ Previous
| Next
]
Thread:
[ Previous
| Next
]
Index:
[ Author
| Date
| Thread
]
[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine
On Wed, 22 Jul 1998, Joel Kelso wrote:
> s001gmu#nova,wright.edu wrote:
>
> > so, yes, it is 'tick-based', but only inasmuch as the computer is tick
> > based. I don't impose any artificial ticks on top of the system ticker.
> > :) I do allow for the definition of a GRAIN, but that is only for
> > shorthand. It gets a bit cumbersome to schedule an event to go off in one
> > week of real time if you have to measure it down to the nanosecond. The
> > Grain is just an int multiplied to the offset before it is added to the
> > current time:
> >
> > t += offset * GRAIN;
>
> Hey, this might be obvious, but how do you get a system clock milliseconds
> or microseconds (nanoseconds ?) in Unix ? Is there a POSIX standard
> function for this ?
There are two functions, gettimeofday() and clock_gettime().
gettimeofday() uses seconds and microseconds, clock_gettime() uses seconds
and nanoseconds. I can't recall which one I used, but I remember there
being trouble with one of them on my linux box. I do not believe they are
POSIX (their man pages mention nothing about POSIX), but they are MT-safe.
-Greg
- Thread context:
- [MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine, (continued)
- [MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine,
s001gmu s001gmu#nova,wright.edu, Mon 20 Jul 1998, 15:57 GMT
- [MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine,
Oliver Jowett oliver#jowett,manawatu.planet.co.nz, Mon 20 Jul 1998, 21:51 GMT
- [MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine,
s001gmu s001gmu#nova,wright.edu, Tue 21 Jul 1998, 13:49 GMT
- [MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine,
Joel Kelso joel#ee,uwa.edu.au, Wed 22 Jul 1998, 02:21 GMT
- [MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine,
s001gmu s001gmu#nova,wright.edu, Wed 22 Jul 1998, 13:30 GMT
- [MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine,
J C Lawrence claw#under,engr.sgi.com, Wed 22 Jul 1998, 17:54 GMT
- [MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine,
Adam Wiggins adam#angel,com, Wed 22 Jul 1998, 20:43 GMT
- [MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine,
Todd Lair tlair#mailzone,com, Tue 21 Jul 1998, 02:44 GMT
[ Other Periods
| Other mailing lists
| Search
]