It is currently Sat Feb 27, 2021 10:48 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Timing a function
PostPosted: Mon Nov 03, 2003 10:56 am 
Offline
User
User

Joined: Mon Oct 13, 2003 6:38 pm
Posts: 68
I want to find out how long it takes for a function to run...

timer on
CallFunction(blah,blah etc etc)
timer off
get time in millisecs

Any ideas please?

Alan


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 03, 2003 11:01 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Apr 25, 2003 6:35 pm
Posts: 188
Location: Athens,Greece
i think someone has made a lib for that ( :?: )
but you can do it as such

time = GetTickCount_()
YourFunction()
debug GetTickCount_()-time

_________________
Christos


Top
 Profile  
Reply with quote  
 Post subject: Re: Timing a function
PostPosted: Mon Nov 03, 2003 1:31 pm 
Offline
Enthusiast
Enthusiast

Joined: Sun Apr 27, 2003 4:54 pm
Posts: 291
Location: Germany
alanuk wrote:
I want to find out how long it takes for a function to run...

timer on
CallFunction(blah,blah etc etc)
timer off
get time in millisecs

Any ideas please?

Alan


This is in millisec:

t1=timeGetTime_()
allFunction(blah,blah etc etc)
t2=timeGetTime_()-t1

../tomio


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 03, 2003 5:49 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Mon Jun 02, 2003 1:42 am
Posts: 2010
Location: Ashland, KY
There is also

http://forums.purebasic.com/english/vie ... ght=timers

_________________
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 03, 2003 7:30 pm 
Offline
User
User

Joined: Mon Oct 13, 2003 6:38 pm
Posts: 68
Thanks guys. Those tips were a great help, and worked fine. If it was in my help file (3.8) I wouldn't have had to ask. But who cares, with a helpful forum such as this, I can live without it's completeness !!

regards Alan


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Nov 04, 2003 3:31 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Fri Apr 25, 2003 5:24 pm
Posts: 7581
> If it was in my help file (3.8) I wouldn't have had to ask.

It's not in the help file because GetTickCount is an API command (as are
all commands ending with an underscore). All such commands are part
of another huge set of docs for Windows programmers, and as such are
not included with PureBasic because they are not PureBasic-specific.
See the FAQ in the Beginners forum for more details.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Nov 04, 2003 7:12 pm 
Offline
User
User

Joined: Mon Oct 13, 2003 6:38 pm
Posts: 68
Thanks PB, your comments are appreciated. We learn a little bit each day.

Alan


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 31 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye