user-1: ping doesn't return anything so what is it used for?
If a user wants to ping and check ping time for all peers, getpeerinfo can be used.

user48884: The help text is your friend:
Requests that a ping be sent to all other nodes, to measure ping time.
Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds.
Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping

After you use ping, you may see a new field, pingwait, in the getpeerinfo output. This is the time for waiting for the ping response. You will also see pingtime being updated once the peer responds to the ping. The purpose is to get an update on the ping times since the ping time reported may have been measured a long time ago.

-1: <p><a href="https://bitcoincore.org/en/doc/0.21.0/rpc/network/ping/" rel="nofollow noreferrer"><code>ping</code></a> doesn't return anything so what is it used for?</p>
<p>If a user wants to ping and check ping time for all peers, <a href="https://bitcoincore.org/en/doc/0.21.0/rpc/network/getpeerinfo/" rel="nofollow noreferrer"><code>getpeerinfo</code></a> can be used.</p>
 48884: <p>The help text is your friend:</p>
<pre><code>Requests that a ping be sent to all other nodes, to measure ping time.
Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds.
Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping
</code></pre>
<p>After you use <code>ping</code>, you may see a new field, <code>pingwait</code>, in the <code>getpeerinfo</code> output. This is the time for waiting for the ping response. You will also see <code>pingtime</code> being updated once the peer responds to the ping. The purpose is to get an update on the ping times since the ping time reported may have been measured a long time ago.</p>
