public static IDisposable Invariant() { var currentCulture = System.Globalization.CultureInfo.CurrentCulture; System.Globalization.CultureInfo.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; return(DisposableLock.Lock(() => { System.Globalization.CultureInfo.CurrentCulture = currentCulture; })); }
public static IDisposable Measure(Action <TimeSpan> result) { var sw = new System.Diagnostics.Stopwatch(); sw.Start(); return(DisposableLock.Lock(() => { sw.Stop(); result(sw.Elapsed); })); }