Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const string clientAccount = "3801000BL040264";
- bool firstRun = true;
- var minMax = OracleInternetBank.OracleDb.Instance.GetMinMax(clientAccount);
- var rawList = OracleInternetBank.OracleDb.Instance.ListBolcardInvoiceLinq(clientAccount);
- var stopWatch = new Stopwatch();
- for (int j = 0; j < 5; j++)
- {
- if (firstRun)
- {
- for (int i = 0; i < 5; i++)
- {
- GetForeachResult(clientAccount, rawList, minMax);
- }
- Console.WriteLine("Warm up finish");
- }
- stopWatch.Start();
- for (int i = 0; i < 50; i++)
- {
- GetForeachResult(clientAccount, rawList, minMax);
- }
- stopWatch.Stop();
- TimeSpan ts = stopWatch.Elapsed;
- Console.WriteLine(String.Format("Foreach: {0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10));
- GC.Collect();
- if (firstRun)
- {
- for (int i = 0; i < 5; i++)
- {
- GetLinqResult(clientAccount, rawList, minMax);
- }
- Console.WriteLine("Warm up finish");
- }
- stopWatch.Start();
- for (int i = 0; i < 50; i++)
- {
- GetLinqResult(clientAccount, rawList, minMax);
- }
- stopWatch.Stop();
- ts = stopWatch.Elapsed;
- Console.WriteLine(String.Format("LINQ: {0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10));
- firstRun = false;
- GC.Collect();
- }
- Console.WriteLine("Finished.");
- Console.ReadKey();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement