portal64-still-alive
portal64-still-alive copied to clipboard
Decouple time interface from libultra
We can replace libultra's OSTime
with a typedef ... Time
which can be library-dependent or library-independent, in which case each library implementation can define functions to convert to/from its internal time format.
Then we can add to the time interface a gettime
function to get the now time and a difftime
function to compute the difference of two times.
There is nothing more to add beyond what @mwpenny suggested about OSTimer
in https://github.com/mwpenny/portal64-still-alive/pull/47#issuecomment-2076240521:
Note that the game's
OSTimer
usage is only for creating a delay - it is effectively just an asynchronoussleep()
and can be wrapped as such
We can add to the time interface a sleep
function which causes the calling thread to sleep until the seconds specified have elapsed.