Add timer and "no errors" reporting#63
Conversation
Get loop index correctly Solve #38
Handle quotes in sub-files
Flag when sub-do-file not found
Handle loops correctly with new command parser
Fixes a few characters in strings
| timer clear 1 | ||
| timer on 1 |
There was a problem hiding this comment.
I would suggest using a higher number -- if the user is using a timer, they may use 1 and this will cause an error or other collision.
| if `r(t1)' > 60 { | ||
| local duration : di %9.3f `r(t1)'/60 | ||
| noi di as res "" | ||
| noi di as res `"{phang}Total run time: `duration' minutes {p_end}"' | ||
| } | ||
|
|
||
| else { | ||
| local duration : di %9.3f `r(t1)' | ||
| noi di as res "" | ||
| noi di as res `"{phang}Total run time: `duration' seconds {p_end}"' | ||
| } | ||
|
|
There was a problem hiding this comment.
%9.2f is probably sufficient, but you may instead consider reporting MM:SS when it runs over 60 seconds; and HH:MM:SS when it runs over 60 minutes, as this is more standard notation and easier for the user to interpret. Reporting days is probably unnecessary.
| local prev_line2 "" | ||
|
|
||
| * Local for empty tables | ||
| local any_lines_written 0 |
There was a problem hiding this comment.
You might be able to find a way to reset this when "stepping back"; alternatively, you might not want to have this show up until each file is closed for the last time. This may or may not be predictable behavior.
I would suggest, since we will know what line the file has called a sub-do-file at, to report "no differences/errors in lines XX-YY" (don't worry about the exact message wording yet). I think we should be able to pick up XX/YY? @kbjarkefur?
There was a problem hiding this comment.
I have not been able to figure this out. If there are no changes in the main file at all, then it does display "no mismatches...". But I have not been able to figure out how to reset it when "stepping back".
Can think about this more after working on other things for the conference.
|
@bbdaniels Updated the help file here for your review. |
Great start! The example should be modified a little bit. I would not include I would also split into two examples -- one where an issue is due to the lack of a seed, and one where it is due to an unstable sort. We should then include the exact output from Similarly, I would expand the example of a recursive call to show that functionality -- perhaps put a sorting issue in one file and a seeding issue in another, and show how solving them top-to-bottom works (and perhaps put in a cascading issue where solving bottom-to-top does not produce a solution). |
Okay, thanks! I will update the examples. |
@bbdaniels I updated the examples, splitting into two for clarity and reusing content for main.do to keep things concise. I tried to include the result, but the tables don't render well in Markdown or SMCL due to issues with merging cells. It seems that using Maybe @kbjarkefur knows how to do it with Alternatively, we could link to a Dime Wiki article, as we've done for other commands. This would allow us to include screenshots and other details. I can work on this after the Stata conference. |
|
Retargeting to dev so we can finish after conference |
Update tests
timer command was not working with `clear all`



In seconds:
In minutes:
It displays a line if the table is empty:
.
However, if there were any changes reported in the "main.do" file, the line "no mismatches" does not appear when "stepping back into the file." I couldn't determine how to include this, but I believe it is fine (for now at least) since changes were reported at least once in that file. See below: