Skip to content

time: decide unit using largest value#6714

Merged
faho merged 1 commit into
fish-shell:masterfrom
afq984:time-align
Mar 6, 2020
Merged

time: decide unit using largest value#6714
faho merged 1 commit into
fish-shell:masterfrom
afq984:time-align

Conversation

@afq984
Copy link
Copy Markdown
Contributor

@afq984 afq984 commented Mar 5, 2020

Using a unit based on (usr + sys) / 2 could cause one of them to overflow the %6.2F format and mess up alignment. This PR changes it to max(usr, sys).

This PR changes this:

> time sleep 0

________________________________________________________
Executed in    1.62 millis    fish           external 
   usr time  1622.00 micros  409.00 micros  1213.00 micros 
   sys time   50.00 micros   50.00 micros    0.00 micros

to this:

> time sleep 0

________________________________________________________
Executed in    1.90 millis    fish           external 
   usr time    1.43 millis    0.00 micros    1.43 millis 
   sys time    0.52 millis  522.00 micros    0.00 millis

@faho faho added this to the fish 3.2.0 milestone Mar 6, 2020
@faho faho merged commit f0d42ea into fish-shell:master Mar 6, 2020
@faho
Copy link
Copy Markdown
Member

faho commented Mar 6, 2020

Yeah, that's better! Thanks, merged!

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants