Page 1 of 1

Lead time

Posted: Sun May 04, 2025 4:18 pm
by rndrei
How to find out the time of execution of a piece of code? You can read the current time and time after the event, but this is second () seconds. And I need to at milisecond!?

Re: Lead time

Posted: Sun May 04, 2025 4:48 pm
by Axolotl
Have you tried?

Code: Select all

ElapsedMilliseconds() 

Use it like this (with disabled Debugger):

Code: Select all

Global time = ElapsedMilliseconds()
; do some processing
time = ElapsedMilliseconds() - time
As a friendly reminder: Don't forget to use the Help Pages......

Re: Lead time

Posted: Sun May 04, 2025 10:41 pm
by PBJim
Axolotl wrote: Sun May 04, 2025 4:48 pm Use it like this (with disabled Debugger):

Code: Select all

Global time = ElapsedMilliseconds()
; do some processing
time = ElapsedMilliseconds() - time
Not quite, ElapsedMilliseconds() returns a quad variable type (.q) otherwise it will not work on 32-bit systems.

Code: Select all

Global time.q = ElapsedMilliseconds()

Re: Lead time

Posted: Mon May 05, 2025 6:08 am
by Piero
rndrei wrote: Sun May 04, 2025 4:18 pmmilisecond
Image

:wink: