Hi,
Is there a psp sdk version of getTickcount or similar function that I can use to build my timer class?
GetTickCount equilivent?
Are you unable to do even the most basic searching of the psp include files? Try grepping for 'tick' in the psp include files directory. You might even find a function you're looking for.
"We are dreamers, shapers, singers, and makers. We study the mysteries of laser and circuit, crystal and scanner, holographic demons and invocations of equations. These are the tools we employ and we know... many things." -- Elric, B5
-
- Posts: 70
- Joined: Thu Jun 22, 2006 9:24 pm
Code: Select all
int gettick() {
static timeval tv;
gettimeofday(&tv, 0);
return (int)(tv.tv_sec * 1000) + (tv.tv_usec / 1000);
}
I just made my own little GetTickCount function for when i was porting a Quake II MD2 Model loader to PSPGL instead of OpenGL.
I had something like:
Since the 'time' function returns the current second from that clock at GNU or where ever it said, i divided it by 1000 to get it into miliseconds as the key frame required it.
Oh and im just wondering if that would work. I was too lazy to go searching.
I had something like:
Code: Select all
int GetTickCount() {
return time()/1000;
}
Oh and im just wondering if that would work. I was too lazy to go searching.
If you want you can use this function: int sceRtcGetCurrentTick(u64 *tick);
defined in "psprtc.h". It returns a time in microseconds.
Here is a sample how to use it:
edit : "bis repetita placent"... TyRaNiD and I have posted nearly the same post at the same moment! :D
defined in "psprtc.h". It returns a time in microseconds.
Here is a sample how to use it:
Code: Select all
#include <psprtc.h>
//return time in milliseconds
u64 GetTick()
{
u64 temp;
sceRtcGetCurrentTick(&temp);
return temp/1000;
}
void main()
{
u64 tick;
tick = GetTick();
}