diff --git a/latency.php b/latency.php new file mode 100644 index 0000000..ddfbcd0 --- /dev/null +++ b/latency.php @@ -0,0 +1,38 @@ + $host, + 'latency_ms' => $latency_rounded, + ]; + + return json_encode($response, JSON_PRETTY_PRINT); + } else { + return json_encode([ + 'error' => 'Ping failed', + ], JSON_PRETTY_PRINT); + } +} + +$client_ip = $_SERVER['REMOTE_ADDR']; + +echo testLatency($client_ip); +?> \ No newline at end of file