November 2017
Intermediate to advanced
800 pages
30h 51m
English
In both Visual Studio 2017 and Visual Studio Code, open the Recorder.cs file and change its contents to look like this:
using System; using System.Diagnostics; using static System.Console; using static System.Diagnostics.Process; namespace Packt.CS7 { public static class Recorder { static Stopwatch timer = new Stopwatch(); static long bytesPhysicalBefore = 0; static long bytesVirtualBefore = 0; public static void Start() { GC.Collect(); GC.WaitForPendingFinalizers(); GC.Collect(); bytesPhysicalBefore = GetCurrentProcess().WorkingSet64; bytesVirtualBefore = GetCurrentProcess().VirtualMemorySize64; timer.Restart(); } public static void Stop() { timer.Stop(); long bytesPhysicalAfter = GetCurrentProcess().WorkingSet64; ...Read now
Unlock full access