Skip to content

[9.x] Round milliseconds in console output runtime#43400

Merged
taylorotwell merged 1 commit into
laravel:9.xfrom
SjorsO:patch-1
Jul 25, 2022
Merged

[9.x] Round milliseconds in console output runtime#43400
taylorotwell merged 1 commit into
laravel:9.xfrom
SjorsO:patch-1

Conversation

@SjorsO
Copy link
Copy Markdown
Contributor

@SjorsO SjorsO commented Jul 25, 2022

Commands always show how long they took to run in milliseconds with 2 decimal precision. This PR rounds the milliseconds, because having 2 decimal precision on milliseconds is unnecessary.

Before:
image

After:
image

} finally {
$runTime = $task
? (' '.number_format((microtime(true) - $startTime) * 1000, 2).'ms')
? (' '.number_format((microtime(true) - $startTime) * 1000).'ms')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could also use round() here...

@taylorotwell taylorotwell merged commit 6bdc085 into laravel:9.x Jul 25, 2022
Ken-vdE pushed a commit to Ken-vdE/framework that referenced this pull request Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants