Time, date and FPS functions.

Posts 1–15 of 23 · Page 1 of 2
Time, date and FPS functions.
Code:
float	    fLastTickCount = 0.0f;           
float	    fCurrentTickCount;
char	     cFrameRate[30]; 
fCurrentTickCount = clock() * 0.001f;
noFps++;
if((fCurrentTickCount - fLastTickCount) > 1.0f)
{
fLastTickCount = fCurrentTickCount;
sprintf(FPSxD, "%d", noFps);
noFps = 0;
}
Code:
char        date[20];
struct tm * current_tm;
time_t current_time;
time (&current_time);
current_tm = localtime (&current_time);
sprintf( DatexD, "%d-%02d-%d",current_tm->tm_mon+1,current_tm->tm_mday,current_tm->tm_year-100+2000);
Code:
#include <time.h>
char        date[20];
struct tm * current_tm;
time_t current_time;
time (&current_time);
current_tm = localtime (&current_time);
sprintf( TimexD,"%02d:%02d:%02d", current_tm->tm_hour, current_tm->tm_min, current_tm->tm_sec );
Simple ways of doing it /
Nice
My Time Function is a bit smaller. And i think you dont have to include the time.h.
Bcuz i didnt included it and it works.
Quote Originally Posted by Sydney View Post
My Time Function is a bit smaller. And i think you dont have to include the time.h.
Bcuz i didnt included it and it works.
It's the thought of releasing it and helping people that counts
Much simpler than Coryster2100's way
Quote Originally Posted by flameswor10 View Post
It's the thought of releasing it and helping people that counts
Much simpler than Coryster2100's way
Thats true.
I just said that mine if a bit smaller. Well Gj Flame.
the is now without the "/" at beginning xD

Creditz for FPS: Sardonik(i think)
time idk but its so simple xD
Good job dude and thanks
....Why this again?
Thanks man, good job.
Nice Job Bro. But there is a slightly better way of doing it!
cOLD

Quote Originally Posted by NOOB View Post
cOLD

Spam much ?
Quote Originally Posted by NOOBJr View Post
Nice Job Bro. But there is a slightly better way of doing it!
I know. But Just showing one way of doing these things
xD I do time and date differently.
[php]#include <ctime>
time_t t = time(0);
cpp.PrintText(ScreenCenterX-1, 10, D3DCOLOR_XRGB(0,0,0), cpp.pFont1, ctime(&t));[/php]
Very simple...
Quote Originally Posted by seeplusplus View Post
xD I do time and date differently.
[php]#include <ctime>
time_t t = time(0);
cpp.PrintText(ScreenCenterX-1, 10, D3DCOLOR_XRGB(0,0,0), cpp.pFont1, ctime(&t));[/php]
Very simple...
This is a way easyer way lol
Posts 1–15 of 23 · Page 1 of 2
This thread is closed for replies.

Tags for this Thread

None

Talk with us