execution time of a macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

execution time of a macro

Thomas GUILBERT
Hello,

is there a simple way to calculate the execution time of a macro ?

Thanks,

Thomas.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: execution time of a macro

Christine Labno-2
Hello Thomas,

>is there a simple way to calculate the execution time of a macro ?

Try putting

start = getTime();

at the beginning of the macro code you wish to time and then

print((getTime()-start)/1000);  

at the end of the code.  Time is returned in milliseconds, this divides by 1000 to give runtime in seconds.

I will add this caveat from the description of getTime on the ImageJ homepage: "The granularity of the time varies considerably from one platform to the next. On Windows NT, 2K, XP it is about 10ms. On other Windows versions it can be as poor as 50ms. On many Unix platforms, including Mac OS X, it actually is 1ms. "

Hope this helps,
Christine

--------------------------------------------
Christine Labno, Ph.D.
Asst. Technical Director
Light Microscopy Core
University of Chicago
Office of Shared Research Facilities
KCBD 1250 900 E. 57th St.
(773) 834-9040 (phone)

________________________________________
From: ImageJ Interest Group [[hidden email]] on behalf of Thomas GUILBERT [[hidden email]]
Sent: Monday, May 18, 2015 11:07 AM
To: [hidden email]
Subject: execution time of a macro

Hello,

is there a simple way to calculate the execution time of a macro ?

Thanks,

Thomas.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: execution time of a macro

Thomas GUILBERT
Hello Christine,

Actually, it does help.
Thank you for your quick answer.

Thomas.

Le 18/05/2015 18:41, Christine Labno a écrit :

> Hello Thomas,
>
>> is there a simple way to calculate the execution time of a macro ?
> Try putting
>
> start = getTime();
>
> at the beginning of the macro code you wish to time and then
>
> print((getTime()-start)/1000);
>
> at the end of the code.  Time is returned in milliseconds, this divides by 1000 to give runtime in seconds.
>
> I will add this caveat from the description of getTime on the ImageJ homepage: "The granularity of the time varies considerably from one platform to the next. On Windows NT, 2K, XP it is about 10ms. On other Windows versions it can be as poor as 50ms. On many Unix platforms, including Mac OS X, it actually is 1ms. "
>
> Hope this helps,
> Christine
>
> --------------------------------------------
> Christine Labno, Ph.D.
> Asst. Technical Director
> Light Microscopy Core
> University of Chicago
> Office of Shared Research Facilities
> KCBD 1250 900 E. 57th St.
> (773) 834-9040 (phone)
>
> ________________________________________
> From: ImageJ Interest Group [[hidden email]] on behalf of Thomas GUILBERT [[hidden email]]
> Sent: Monday, May 18, 2015 11:07 AM
> To: [hidden email]
> Subject: execution time of a macro
>
> Hello,
>
> is there a simple way to calculate the execution time of a macro ?
>
> Thanks,
>
> Thomas.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
Thomas GUILBERT, PhD
Plate-Forme Cochin Imagerie,
Institut Cochin - INSERM U1016
Bât. Gustave Roussy 5ème étage
22 rue Méchain, 75014 PARIS
 
tel: 01 40 51 66 55

http://www.cochin.inserm.fr/
[hidden email]

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html