zsh-workers
 help / color / mirror / code / Atom feed
* [bug] times builtin output wrong
@ 2014-05-26 20:13 Stephane Chazelas
  2014-05-29 19:45 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Stephane Chazelas @ 2014-05-26 20:13 UTC (permalink / raw)
  To: Zsh hackers list

$ times
0m3.36s 0m1.95s
0m12.23s 0m0.15s
$ time
shell  2.02s user 1.17s system 1% cpu 3:36.66 total
children  7.34s user 0.10s system 3% cpu 3:36.66 total
$ echo $((7.34*100/60))
12.233333333333333

It looks like they're expressed in 60/100th of seconds.

The code has:

/* display a time, provided in units of 1/60s, as minutes and seconds */
#define pttime(X) printf("%ldm%ld.%02lds",((long) (X))/3600,\
                         ((long) (X))/60%60,((long) (X))*100/60%100)

So it kind of assumes the times are in 1/60s but they're not, they're in clock
ticks.

The "time" output is correct though.

-- 
Stephane


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-29 19:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-26 20:13 [bug] times builtin output wrong Stephane Chazelas
2014-05-29 19:45 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).