Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[bug] times builtin output wrong
- X-seq: zsh-workers 32622
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: [bug] times builtin output wrong
- Date: Mon, 26 May 2014 21:13:18 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mail-followup-to:mime-version :content-type:content-disposition:user-agent; bh=m1Xf++YqN5ZUmrFqUeWuaV984DNIWvMYmWKCBouYUJI=; b=v3Y9D+2Gw81alGDnmJLFm8fEiHMb+tgcnWAkd65wWB/pi1peEycU5O5ovYvbb2O3y9 ault+YOm37080CHV1W4L/O2F/qwB1td+cYvb3MVzvvJ7EcqjGKPz8s5twb6STazg99C8 IIAOjzKJCkpSHBwEw66CAdCry9JqJzTsBhISZ8grQ1/q346rsqzmrtZV0nyXnz+EW9PN nBJSEFLrqBSdjhRIByThPbBDvNK2MXhODa3fv4FXB6Zuybi0jl+7Xd6XF8uWqk6NnsPe 9lH48idYI4qhywlyeQv3Tv68G4cXUi+7bAnouNPjd78xEq7XH/bYxt9synV7ZI7lIIjo yZew==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: Zsh hackers list <zsh-workers@xxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
$ 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author