Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: problem with sleep / winexec / shell

From   "David Elliott" <>
Subject   Re: st: problem with sleep / winexec / shell
Date   Fri, 26 May 2006 14:35:49 -0300

I suspect that Stata is "pausing" by running an arbitrary loop that
checks sytem time.  when I issue -sleep 10000- I get 10 seconds of
~50% CPU utilization by Stata.  This, of course, is inefficient,
especially if the winexeced program takes a lot of CPU itself.

What you might consider doing is turning the problem inside out.

You basically have a program that goes:
1) Part A
2) winexec external program and create file
3) Part B with requiring the new file

Consider running Stata from a shell using commands in this form:.

Stata /e do (do the first part)
extpgm.exe (run the program that creates the file)
Stata /e do PartB

For windows from NT onward you could put this together with:
[path]stata.exe /do && [path]extpgm.exe && [path]stata.exe
/do and run it as a command script. the && combine the
commands and run them in sequence.

For reference:
*   For searches and help try:

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