Skip to content

[Console] formatTime helper returns incorrect time #18420

Closed
@twifty

Description

@twifty

I've noticed, while using the ProgressBar class, the elapsed time correctly counting seconds, switching to "1 min" then a second later jumping up to "2 mins". I've narrowed the problem down to the Helper::formatTime method:

return ceil($secs / $format[2]).' '.$format[1];

shouldn't it be using floor?

On a second thought, no it shouldn't. using floor will result in strings like "1 mins".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions