Thread: Time & FPS

Results 1 to 5 of 5
  1. #1
    Flengo's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    /admincp/banning.php
    Posts
    20,591
    Reputation
    5180
    Thanks
    14,178
    My Mood
    Inspired

    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 | IM
    Staff Administrator Since 10.13.2019
    Publicist Since 04.04.2015
    Middleman Since 04.14.2014
    Global Moderator Since 08.01.2013
    Premium Since 05.29.2013

    Minion+ Since 04.18.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-01-2011)

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

  4. #3
    yomo710's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    United States
    Posts
    868
    Reputation
    9
    Thanks
    115
    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,858
    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, 10:53 AM
  2. My Time.
    By Dave84311 in forum News & Announcements
    Replies: 8
    Last Post: 11-24-2007, 10:45 PM
  3. Free Infantry, time to kill it
    By Super-Man in forum General Game Hacking
    Replies: 2
    Last Post: 01-09-2006, 01:58 PM
  4. cap 4 flag in 1 time
    By slash83 in forum WarRock - International Hacks
    Replies: 8
    Last Post: 01-04-2006, 04:24 AM