﻿// Decompiled with JetBrains decompiler
// Type: log4net.Layout.Pattern.RelativeTimePatternConverter
// Assembly: log4net_webplayer, Version=1.2.10.9, Culture=neutral, PublicKeyToken=null
// MVID: 264EA252-48EC-47A6-AEFF-91CFCAAFCFCB
// Assembly location: C:\Users\CGA Computer\Desktop\LEGO Universe Stuff\LOCO Server\Unity Web Player Extractor\Saved Files\LOCO Server.unity3d_unpacked\log4net_webplayer.dll

using log4net.Core;
using System;
using System.Globalization;
using System.IO;

namespace log4net.Layout.Pattern
{
  internal sealed class RelativeTimePatternConverter : PatternLayoutConverter
  {
    protected override void Convert(TextWriter writer, LoggingEvent loggingEvent)
    {
      writer.Write(RelativeTimePatternConverter.TimeDifferenceInMillis(LoggingEvent.StartTime, loggingEvent.TimeStamp).ToString((IFormatProvider) NumberFormatInfo.InvariantInfo));
    }

    private static long TimeDifferenceInMillis(DateTime start, DateTime end)
    {
      return (long) (end.ToUniversalTime() - start.ToUniversalTime()).TotalMilliseconds;
    }
  }
}
