forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Epoch Time?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Yeldarb



Joined: 20 Jul 2005
Posts: 2

PostPosted: Thu Jul 21, 2005 9:43 am    Post subject: Epoch Time? Reply with quote

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
View user's profile Send private message
Yeldarb



Joined: 20 Jul 2005
Posts: 2

PostPosted: Thu Jul 21, 2005 9:47 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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