Files
Stationeers-RemoteControl/Scripts/LogTimer.cs
2026-01-15 00:10:22 +01:00

37 lines
1003 B
C#

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);
}
}
}