Jesper Lund wrote:
So, a portable way to get fractions of a second would be a fine thing (micro seconds will not always be possible; under Dos, e.g., the resolution is 1/18.2 seconds, unless you do direct hardware manipulation)...
If we forget about portability for a minute, under DOS (DJGPP) there is a libc function, uclock (), which provides (very) high-resolution timing.
Fine, I didn't know this.
It would be fine if someone could extend the time data types and functions to make use of it and the functions that are available on other systems.
Perhaps fields for 1/100 seconds and microseconds, along with flags that say if these values are good, so that the data types can be portable though the time functions will differ.
Then a built-it Randomize could use the time stamps.
For my compatibility random unit, I won't use it, but rather use a Dos call, exactly like BP.