12345678910111213141516171819202122232425262728293031 |
- 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;
- using ZstdSharp.Unsafe;
- 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");
- }
- }
- }
|