Raised This Month: $51 Target: $400
 12% 

Module: Execution Time v1.0 [Linux + Windows]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 11-03-2012 , 09:35   Module: Execution Time v1.0 [Linux + Windows]
Reply With Quote #1

Execution Time
1.0




Informations

♠ You will be able to view how much time a function take.

Header File

Code:
/* Counts by now */ native Execution_Time_Stick( ); /* Returns time counted, float inside string */ /* Do not exceed 128 characters */ /* 16 characters is a good value to use */ native Execution_Time_Return( String[ ], Length ); /* Transforms float inside string in pure float */ stock Float: Execution_Time_Return_Float( String[ ] )     return str_to_float( String );

Example of Plugin

PHP Code:
#include < amxmodx >
#include < execution_time >

new g_String16 ];

public 
plugin_init( ) {
    
Execution_Time_Stick( );

    for( new 
024000i++ )
        
server_print"1 + 1 = 2" );

    
Execution_Time_Returng_Stringcharsmaxg_String ) );

    
server_print"Printing 24,000 lines to server's console took %f seconds!"Execution_Time_Return_Floatg_String ) );

    
Execution_Time_Stick( );

    for( new 
012000i++ )
        
server_print"1 + 1 = 2" );

    
Execution_Time_Returng_Stringcharsmaxg_String ) );

    
server_print"Printing 12,000 lines to server's console took %f seconds!"Execution_Time_Return_Floatg_String ) );

Function to Remove Unused Zeros

PHP Code:
/*
  Input: "0.200000"
  Output: "0.2"
*/

Remove_Unused_ZerosString[ ] ) {
  for( new 
Iterator strlen( String ) - 1Iterator >= 2Iterator-- ) {
    if( 
StringIterator ] == '0' ) {
      if( 
StringIterator ] == '.' )
        break;

      else
        
StringIterator ] = '^0';
    }
  }

Attached Files
File Type: zip Execution Time Source Code.zip (271.9 KB, 271 views)
File Type: inc execution_time.inc (558 Bytes, 319 views)
File Type: dll execution_time_amxx.dll (64.0 KB, 292 views)
File Type: so execution_time_amxx_i386.so (13.4 KB, 249 views)
__________________

Last edited by claudiuhks; 01-08-2013 at 10:37.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-03-2012 , 09:50   Re: Module: Execution Time v1.0
Reply With Quote #2

The profiler of sawce can do that already. What is the difference ?
__________________
Arkshine is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 11-03-2012 , 09:55   Re: Module: Execution Time v1.0
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
The profiler of sawce can do that already. What is the difference ?
It returns the execution time of a public. Or of how many native calls you have in that public.
It's an AMX Mod X module.
__________________

Last edited by claudiuhks; 11-03-2012 at 09:56.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 11-03-2012 , 09:57   Re: Module: Execution Time v1.0
Reply With Quote #4

Can this module record how long it takes for 1 player to kill 5 enemies?

For example:
Player spawn - Execution_Time_Stick( );
if (kill >= 5)
Execution_Time_Return( g_String, charsmax( g_String ) );

***Edited***
Nevermind, it was public.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019

Last edited by yokomo; 11-03-2012 at 09:59.
yokomo is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 11-03-2012 , 11:37   Re: Module: Execution Time v1.0
Reply With Quote #5

Thanks, this can be very useful.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 11-03-2012 , 11:42   Re: Module: Execution Time v1.0
Reply With Quote #6

Quote:
Originally Posted by yokomo View Post
Can this module record how long it takes for 1 player to kill 5 enemies?

For example:
Player spawn - Execution_Time_Stick( );
if (kill >= 5)
Execution_Time_Return( g_String, charsmax( g_String ) );

***Edited***
Nevermind, it was public.
Yes, yokomo. But just one player.
__________________

Last edited by claudiuhks; 11-03-2012 at 11:43.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 11-03-2012 , 11:45   Re: Module: Execution Time v1.0
Reply With Quote #7

Maybe you can create a system with multiple timers ?
__________________
micapat is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 11-03-2012 , 11:52   Re: Module: Execution Time v1.0
Reply With Quote #8

Quote:
Originally Posted by micapat View Post
Maybe you can create a system with multiple timers ?
Sorry, give me more details. What do you mean with a timer? A task with forward? Like AMX Mod X main extension has?
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-03-2012 , 11:54   Re: Module: Execution Time v1.0
Reply With Quote #9

Quote:
Originally Posted by claudiuhks View Post
It returns the execution time of a public. Or of how many native calls you have in that public.
Not sure to understand "time of a public".
If the purpose is to measure time of a chunk of code, sawce's profiler has 2 natives to do that.
Just wanted to know what is the difference, except the fact this one is a module, which is irrelevant.
__________________
Arkshine is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 11-03-2012 , 11:58   Re: Module: Execution Time v1.0
Reply With Quote #10

Quote:
Originally Posted by Arkshine View Post
Not sure to understand "time of a public".
If the purpose is to measure time of a chunk of code, sawce's profiler has 2 natives to do that.
Just wanted to know what is the difference, except the fact this one is a module, which is irrelevant.
I mean, the time taken by the bunch of natives existing into a forward.
__________________

Last edited by claudiuhks; 11-03-2012 at 11:59.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode