using System; using System.Collections.Generic; using System.Linq; using Assets.Scripts; using Assets.Scripts.Networks; using Assets.Scripts.Objects.Electrical; using Assets.Scripts.Objects.Motherboards; using Assets.Scripts.Util; using JetBrains.Annotations; using RemoteControl.Message; using Swan; using UnityEngine; using GameDevice = Assets.Scripts.Objects.Pipes.Device; // ReSharper disable ClassNeverInstantiated.Global // ReSharper disable MemberCanBePrivate.Global namespace RemoteControl { public class LogTimer : IDisposable { private readonly DateTime _startTime = DateTime.Now; private string _action; public LogTimer(string action) { RemoteControl.Log($"Beginning {action}"); _action = action; } public void Dispose() { var endTime = DateTime.Now; var elapsed = endTime - _startTime; Debug.Log($"Time taken for {_action}: " + elapsed); } } }