Skip to content

os.uptime returns float instead of integer #41636

Closed
@davedodo

Description

@davedodo

Version

v14.18.3

Platform

Linux 5.4.0 #1 SMP Thu Apr 22 16:18:59 MSK 2021 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

os

What steps will reproduce the bug?

I just upgraded from Node.js 12 to 14 (on Ubuntu via nodesource repository) and found that require("os").uptime() now returns a float and no longer an integer as the documentation states. Tested on Ubuntu 18.04 on VirtualBox and Ubuntu 20.04 on a Virtuozzo container. So this is either a bug or the documentation needs an update.

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

os.uptime should return an integer.

What do you see instead?

os.uptime returns a number that is not an integer.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    libuvIssues and PRs related to the libuv dependency or the uv binding.osIssues and PRs related to the os subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions