Async version of PingUrl

suggest change
static void Main(string[] args)
    string url = "";
    var pingTask = PingUrlAsync(url);
    Console.WriteLine($"Waiting for response from {url}");

static async Task<string> PingUrlAsync(string url)
    string response = string.Empty;
    var ping = new System.Net.NetworkInformation.Ping();

    var result = await ping.SendPingAsync(url);

    await Task.Delay(5000); //simulate slow internet

    if (result.Status == System.Net.NetworkInformation.IPStatus.Success)
        response = $"{url} is online";

    return response;

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents