OT: ptime [WAS: Re: stdio performance in tango, stdlib, and perl]

torhu fake at address.dude
Fri Mar 23 11:35:32 PDT 2007


Sean Kelly wrote:
<snip>
> For what it's worth, I created a Win32 version of the Unix 'time' 
> command recently.  Not too complicated, but if anyone is interested, I 
> have it here: http://www.invisibleduck.org/~sean/tmp/ptime.zip  It's a 
> quick and dirty implementation, but works for how I typically use it.

Looks useful, my own tool just measures 'real' time.  But it breaks when 
using redirection, either way:

redirect stdin:
---
c:\prog\test\linetest>ptime cat <test.txt
cat: -: Bad file descriptor

real    0m0.000s
user    0m0.010s
sys     0m0.000s

---

redirect stdout:
---
c:\prog\test\linetest>ptime cat test.txt >NUL

---

The last one outputs nothing.  Printing to stderr would fix that.



More information about the Digitalmars-d mailing list