 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Yeldarb
Joined: 20 Jul 2005 Posts: 2
|
Posted: Thu Jul 21, 2005 9:43 am Post subject: Epoch Time? |
|
|
Hey, I've looked around and searched a bit, but haven't been able to find any answers (found a few similar questions, but they didn't really post their solutions). Is there a (preferably simple) way to get the epoch time? I'm trying to implement a simple timer into a program, but can't find much relevant to this.
I've tried using the datatype time_t, but I can't figure out how to convert that to an integer... It's probably a very simple question -- sorry about that (I'm new to C). |
|
| Back to top |
|
 |
Yeldarb
Joined: 20 Jul 2005 Posts: 2
|
Posted: Thu Jul 21, 2005 9:47 am Post subject: |
|
|
Arg. Don't you hate it when you post stupid questions and then figure it out right after you post?
Here's what worked:
| Code: |
time_t startTime = sceKernelLibcTime(NULL);
time_t curTime;
int i=0;
while(i < 10000) {
i++;
curTime = sceKernelLibcTime(NULL);
printf("Time (%d): %ld\n", i, curTime - startTime);
}
|
The problem was apparently that I was using the wrong modifiers in my printf statement :-\ |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|