What is a sample code for execution measure in ms ?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
liveme
Posts: 240
Joined: Thu Aug 27, 2015 5:22 pm

What is a sample code for execution measure in ms ?

Post by liveme » Mon Jan 18, 2021 8:38 pm

Hi,
Looking for some code on :
How to measure start time/ end time difference in mili or micro seconds...
Query exec time measure or simular purpose ?
Couldnt locate any syntax about that still...
Thanks

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10048
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: What is a sample code for execution measure in ms ?

Post by FourthWorld » Mon Jan 18, 2021 9:17 pm

Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: What is a sample code for execution measure in ms ?

Post by dunbarx » Mon Jan 18, 2021 10:34 pm

Hi.

Go here and read it all. It is an undocumented feature.

http://forums.livecode.com/viewtopic.ph ... croseconds

Craig

liveme
Posts: 240
Joined: Thu Aug 27, 2015 5:22 pm

Re: What is a sample code for execution measure in ms ? [SOLVED]

Post by liveme » Tue Jan 19, 2021 12:20 am

Thanks guys...nice info abuot benchmarking ! Great
Very helpfull, I could come up with some simple code...

Code: Select all

local KronoStart
on dostartkrono
   put the milliseconds into KronoStart
   put "Chrono is ON" into field KronoTime
end dostartkrono

local KronoEnd
on doendkrono
   put the milliseconds into KronoEnd
   put (KronoEnd - KronoStart)&" ms" into field KronoTime
end doendkrono
:wink:

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10048
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: What is a sample code for execution measure in ms ?

Post by FourthWorld » Tue Jan 19, 2021 12:57 am

As I discussed in the article, for durations that short you'll want to get the average of many iterations.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: What is a sample code for execution measure in ms ?

Post by dunbarx » Tue Jan 19, 2021 3:24 pm

Hi.

So you are satisfied with milliseconds only? This is a standard function in LC, like the "ticks" or the "seconds". I thought you were interested in microSeconds.

Note that if you do indeed go down to that level, Richard's comment about taking running averages is even more important, since the machine running such timing gadgetry has a timing mind of its own. :wink:

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7391
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: What is a sample code for execution measure in ms ?

Post by jacque » Wed Jan 20, 2021 6:53 pm

If you really want precision there is also "the long milliseconds" but you'll probably want an even larger pool of averages.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply