help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: measuring script speed


From: BVBA NuKey Music
Subject: Re: measuring script speed
Date: Sun, 18 Dec 2011 17:59:50 +0100



2011/12/18 Ben Abbott <address@hidden>
On Dec 18, 2011, at 11:49 AM, BVBA NuKey Music wrote:

> I thought I could measure the execution time of a script like this:
> begintime=cputime;myscript;cputime-begintime
>
> this does not work however with scripts which start with a clear
> command because the begintime-variable gets erased. Therefore I
> thought in stead of deleting the clear statement for the test, I could
> proceed as follows:
> global begintime=cputime;myscript;cputime-begintime
>
> unfortunately this doesn't work, I also tried this on the linux command line:
> time octave<myscript.m
>
> this works but I see the octave-environment being opened which could
> falsify the timing results
>
> so what's the best way to achieve this?
>
> thanks in advance
> nukey

Try

       tic (); myscript; toc ()

Ben
Thanks, this solves my problem!

best regards,
nukey

reply via email to

[Prev in Thread] Current Thread [Next in Thread]