computing time

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

KarinL
Posts: 25
Joined: Thu Feb 03, 2011 8:45 am

computing time

Postby KarinL » Wed Feb 09, 2011 2:03 am

Hey, I'm using EViews 7.
Is there any command that returns computing time needed, i.e. to solve a MLE using a logl object?
I've got the feeling that my program is very slow and I'd like to compare different versions of my program regarding computing time.
Thanks.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

computing time

Postby EViews Gareth » Wed Feb 09, 2011 8:05 am

Look up "tic" and "toc"

KarinL
Posts: 25
Joined: Thu Feb 03, 2011 8:45 am

Re: computing time

Postby KarinL » Wed Feb 09, 2011 10:04 am

perfect! thanks

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: computing time

Postby EViews Gareth » Wed Feb 09, 2011 10:07 am

I gave the previous response via my phone - hence its short nature.

I find the best way to use tic and toc is to save the toc into a scalar variable rather than just use it to send stuff to the statusline. It can be tricky to organise your program so that toc displays on the statusline, especially if you're using subroutines. If you save it into a scalar, you can then open that scalar up and view it whenever you want.

Thus:

Code: Select all

tic 'some code here scalar time = @toc
I find is better than simply:

Code: Select all

tic 'some code here toc


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests