PureBasic Forum
https://www.purebasic.fr/english/

Timing a function
https://www.purebasic.fr/english/viewtopic.php?f=13&t=8174
Page 1 of 1

Author:  alanuk [ Mon Nov 03, 2003 10:56 am ]
Post subject:  Timing a function

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

Author:  plouf [ Mon Nov 03, 2003 11:01 am ]
Post subject: 

i think someone has made a lib for that ( :?: )
but you can do it as such

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

Author:  Tomio [ Mon Nov 03, 2003 1:31 pm ]
Post subject:  Re: Timing a function

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

Author:  Karbon [ Mon Nov 03, 2003 5:49 pm ]
Post subject: 

There is also

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

Author:  alanuk [ Mon Nov 03, 2003 7:30 pm ]
Post subject: 

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

Author:  PB [ Tue Nov 04, 2003 3:31 am ]
Post subject: 

> 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.

Author:  alanuk [ Tue Nov 04, 2003 7:12 pm ]
Post subject: 

Thanks PB, your comments are appreciated. We learn a little bit each day.

Alan

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/