Timing Scripts...
#1

I've just realised it was on the wiki...

Thanks anyway

- Ash


Hi all
A lot of talk about Code Optimization (especially from ****** ) has got me thinking about my own scripts, and i was thinking of running a seed test on some of my functions and commands. But i have forgotten how to do it. I know it was posted on one of ******' threads before, however i can no longer find that specific thread. Can anyone point me to that thread, or tell me how to do it?

I know its something to do with either tickcount(granularity) or GetTickCount()

Thanks
Ash
Reply
#2

You could do it a few ways

pawn Код:
new
    t;
t = GetTickCount( );
for ( new i; i < 500000; ++i )
{
    func( );
}
printf( "%i", GetTickCount( ) - t );
or

pawn Код:
func( )
{
    static
        t;
    printf( "%i", GetTickCount( ) - t );
    t = GetTickCount( );
    // code
}
Reply
#3

Thanks, however i know now thanks to the wiki, and you!

I'd edited my first post before you posted though.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)