getting the time on EE?

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
bbraun
Posts: 5
Joined: Sat Jan 01, 2005 1:11 am

getting the time on EE?

Post by bbraun »

Is there a way to get the time on the EE with the ps2sdk? I see several timer functions, but nothing for either getting the current time, or for measuring the passage of time. I noticed in the iop/ sub directory there is a getPs2Time() in libhdd, and a GetSystemTime() in kernel but I am unsure of their relation to the EE code.
Shine
Posts: 728
Joined: Fri Dec 03, 2004 12:10 pm
Location: Germany

Post by Shine »

You can use the timer: http://forums.ps2dev.org/viewtopic.php?t=878 It has an resolution of about 2 us and counts 113 ms, if setting with the maximum divider of system clock / 256.

In CVS are another nice functions for using the internal EE performance counters: http://cvs.ps2dev.org/ps2Perf/

If you have 300 ms time to read the clock and if you need the realtime clock, you can use the cdReadClock, but I don't have example code for it.
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

The RTC is attached to the CDVD controller which means getting the time from the EE is very slow and can be a hassle.
Shoot Pixels Not People!
Makeshift Development
Post Reply