I saw the sample in Kernel/systimer... But that's not what I need.
Could anyone guide me towards what I need to keep track of time in Microseconds?
Thanks,
Microsecond Accurate Hardware timer
-
- Posts: 328
- Joined: Sun Jun 03, 2007 10:05 pm
Microsecond Accurate Hardware timer
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Use it more for Development than for Gaming.
-
- Posts: 328
- Joined: Sun Jun 03, 2007 10:05 pm
For example, I read cop0 counter using this code in kernel mode :
Maybe there are a better way to do this ?
Code: Select all
int
getCycleCounter (void)
{
int value;
__asm__ __volatile__(
"mfc0 %0, $9 \n"
: "=r" (value));
return value;
}
-
- Posts: 328
- Joined: Sun Jun 03, 2007 10:05 pm
Using clock() now. Res: defined as CYCLES_PER_SEC = 1000000Art wrote:did you find the resolution for systimer?
I thought it would be better than microseconds.
Just use the real time clock then.
Will also try cop0 example above.
Systimer? what?
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Use it more for Development than for Gaming.
You said in your first post you saw the sample for systimer.
It's tick resolution is unclear at best:
http://www.geardome.com/pspsdk-doc/pspsystimer_8h.html
Was asking did you figure out the tick resolution? I assume not...
It's tick resolution is unclear at best:
http://www.geardome.com/pspsdk-doc/pspsystimer_8h.html
Was asking did you figure out the tick resolution? I assume not...
-
- Posts: 328
- Joined: Sun Jun 03, 2007 10:05 pm
It needs a callback thread... I wouldn't bother.Art wrote:You said in your first post you saw the sample for systimer.
It's tick resolution is unclear at best:
http://www.geardome.com/pspsdk-doc/pspsystimer_8h.htmlr
Was asking did you figure out the tick resolution? I assume not...
Yes, How to find the MAX accurate resolution is unclear.
I'm fixed with clock() and it's very accurate with my stopwatch;
Thanks!
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Use it more for Development than for Gaming.