SysMonitoring
  • Introduction
  • Installation
  • Configuration
  • Troubleshooting
  • Functions
    • startServer()
    • stopServer()
    • getCpuLoad()
    • getMemoryUsage()
    • getPing()
  • API
    • /cpu
    • /memory
    • /ping
  • Terminal Commands
    • echo
    • time
    • help
    • stats
Powered by GitBook
On this page
  • getPing()
  • Overview
  • Usage
  • Description
  1. Functions

getPing()

getPing()

Overview

The getPing() function retrieves the current network latency (ping) by using the inetLatency() method from the systeminformation library. It returns the latency in milliseconds (ms).

Usage

const ping = await monitoring.getPing();

Description

  • getPing() fetch the network latency (ping).

  • The result is returned in milliseconds (ms), representing the round-trip time for network communication.

  • This function is asynchronous, so it returns a promise and should be used with await.

Use this function to monitor network latency in real-time or log the ping status for your application.

PreviousgetMemoryUsage()Next/cpu

Last updated 5 months ago