using Microsoft.Extensions.Logging;
using RestSharp;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace EVCB_OCPP.WSServer.Service
{
    public class GoogleGetTimePrintService
    {
        private readonly ILogger<GoogleGetTimePrintService> logger;

        public GoogleGetTimePrintService(ILogger<GoogleGetTimePrintService> logger)
        {
            this.logger = logger;
        }

        public async Task Print()
        {
            var client = new RestClient("http://www.google.com");
            var stopWatch = Stopwatch.StartNew();
            await client.ExecuteAsync(new RestRequest("",method: Method.Get));
            stopWatch.Stop();
            logger.LogInformation($"Google Get Cost {stopWatch.ElapsedMilliseconds}ms");
        }
    }
}