Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite Row_printTime() with various improvements #1325

Merged
merged 1 commit into from
Nov 10, 2023

Commits on Nov 9, 2023

  1. Rewrite Row_printTime() with various improvements

    * Change variable types of time values from signed to unsigned.
    * Change variable naming for consistency: `totalMinutes`, `totalHours`,
      `totalDays` for total values and `minutes`, `hours`, `days`, etc. for
      remainder values. (`years` remains an exception as there is no larger
      unit than years)
    * Use `unsigned long long` type for `years` value to prevent a
      potential overflow.
    * The time units are now evaluated from small to large, in the hopes
      that small values would print faster. (There is no performance test
      for this claim.)
    * The days unit is now printed when `totalHours` is at least 24.
      (Issue htop-dev#1317) There is room in the new code to revert to the
      old threshold (totalHours < 2400).
    
    Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
    Explorer09 committed Nov 9, 2023
    Configuration menu
    Copy the full SHA
    22c5aa4 View commit details
    Browse the repository at this point in the history