Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: time elapsed within 'for' loops

From   David K Evans <[email protected]>
To   [email protected]
Subject   st: time elapsed within 'for' loops
Date   Sun, 14 Nov 2004 05:54:58 -0500 (EST)

Stata friends,

Is there a simple way to see how much time has elapsed while a command in
the midst of a "for" loop is running?

Outside of a loop, I just "set rmsg on" and can see how long each command

But if I have, for example,

for num 1/10: preserve \ keep if age==X \ reshape [blah blah blah] \
save ageX.dta, replace \ restore;

and I want to know how long the reshaping took, I'm not sure how to find
out. "set rmsg on" only gives me the time for the entire loop.

I know about macros to display the time, but I'm not sure how to
manipulate them to calculate time elapsed.

Thanks so much,


PhD student, Harvard Economics Department
Phone: (O) 617-495-5634, (H) 617 - 493 - 1536
Address: Currier Mail Center #554, Cambridge, MA 02138

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index