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.

Last updated