Thread: Time & FPS

Results 1 to 5 of 5
  1. #1
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    Ontario, Canada
    Posts
    15,693
    Reputation
    3319
    Thanks
    11,105
    My Mood
    Happy

    Time & FPS

    Didn't see it up here, pretty simple. Just thought I'd share for those who didn't have it.

    Simple Time Display:

    Code:
    #include <ctime>
    
    time_t t = time(0);
    
    //To Use
    DrawString(x, y, Colour,pFont, ctime( &t ));
    FPS Display:

    Code:
    char sFPS[20]="xxx Fps";
    
    
    int	  FPScounter = 0;
    float FPSfLastTickCount = 0.0f;
    float FPSfCurrentTickCount;
    
    void FPScheck(char *str, char *format)
    {
    	FPSfCurrentTickCount = (clock() * 0.001f);
    	FPScounter++;
    
    	if((FPSfCurrentTickCount - FPSfLastTickCount) > 1.0f) {
    	    FPSfLastTickCount = FPSfCurrentTickCount;
    		sprintf(str,format,FPScounter);
    	    FPScounter = 0;
    	} 
    }
    
    //To use
    DrawString(x, y, Colour, pFont, sFPS);
    Credits to whoever.


    I Read All Of My PM's & VM's
    If you need help with anything, just let me know.
     
     
    VM | PM

    Publicist Since 04.04.2015
    Middleman Since Unknown - Unknown
    Global Moderator Since 08.01.2013
    Donator Since 05.29.2013

    Minion+ Since 04.18.2013

    District 187 Minion Since 04.04.2013
    Steam Minion Since 02.26.2013
    WarRock Minion Since 02.19.2013
    A.V.A Minion Since 02.13.2013
    DayZ Minion Since 01.21.2013
    Combat Arms Minion Since 12.26.2012
    Contributor Since 11.16.2012
    Member Since 05.11.2010


  2. The Following User Says Thank You to Flengo For This Useful Post:

    AllMarcos (11-02-2011)

  3. #2
    Nightmare's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    North of Hell
    Posts
    2,399
    Reputation
    149
    Thanks
    6,560
    My Mood
    Worried
    Good job bro!

  4. #3
    yomo710's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    United States
    Posts
    867
    Reputation
    9
    Thanks
    113
    My Mood
    Amused
    thx this is really helpful
    I usually don't spend this much time on the internet, but when I do, I'm on some forum.
    Gift me credits or BTC! 1MktRupu3Goup79PrnYFW13bRi9wciiWWs


    Buying all starbucks accounts with currency!

  5. #4
    AllMarcos's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Posts
    140
    Reputation
    10
    Thanks
    21
    My Mood
    Cool
    very good
    I use in my next release

  6. #5
    TokolocoSK's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Location
    Comendo Peru Pato Frango Búrguer.
    Posts
    2,874
    Reputation
    65
    Thanks
    6,784
    My Mood
    Yeehaw
    In FPS need to add these libraries

    Code:
    #include <time.h>
    #include <stdio.h>



Similar Threads

  1. [Release] Time, date and FPS functions.
    By flameswor10 in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 22
    Last Post: 12-19-2010, 11:53 AM
  2. My Time.
    By Dave84311 in forum News & Announcements
    Replies: 8
    Last Post: 11-24-2007, 11:45 PM
  3. Free Infantry, time to kill it
    By Super-Man in forum General Game Hacking
    Replies: 2
    Last Post: 01-09-2006, 02:58 PM
  4. cap 4 flag in 1 time
    By slash83 in forum WarRock - International Hacks
    Replies: 8
    Last Post: 01-04-2006, 05:24 AM