import * as dns from "dns";
import * as ping from "net-ping";

export class Utils {
    public static checkInternet(): Promise<boolean> {
        return new Promise(resolve => {
            dns.resolve('gaminggeneration.de', (err) => {
                if (err)
                    resolve(false);
                else
                    resolve(true);
            });
        });

    }

    static sleep(ms: number): Promise<void> {
        return new Promise(resolve => {
            setTimeout(() => resolve(), ms);
        })
    }

}