[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: measuring script speed
From: |
Ben Abbott |
Subject: |
Re: measuring script speed |
Date: |
Sun, 18 Dec 2011 11:53:34 -0500 |
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