High performance looping

using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.Threading; using System.Threading.Tasks; namespace FastLoopingConsole { class Program { static void Main(string[] args) { Stopwatch sw = new Stopwatch(); long MaxNumber = 2500000000; ///////////////////////////////////////////////////////////// long sum = 0; sw.Restart(); sum = 0; Parallel.For(0, MaxNumber, (i) => { Interlocked.Add(ref sum, (long) Math.Sqrt(i)); }); sw.Stop(); Trace.WriteLine($”Method_1 (Parallel.For): Sum…