|
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using HelloWorldServiceProxies;
namespace TestHarness
{
class Program
{
static void Main(string[] args)
{
runOptions();
}
private static void runOptions()
{
Console.Clear();
Console.WriteLine("PROXY MANAGER TEST HARNESS");
Console.WriteLine("Press <R> to Run test any other key to exit:");
var s = Console.ReadKey();
if (s.Key == ConsoleKey.R) {runTest();}
}
private static void runTest()
{
Console.Clear();
var sw = new Stopwatch();
var sw2 = new Stopwatch();
var avgTimes = new List<int>();
sw2.Start();
for (var i = 1; i < 1001; i++)
{
sw.Start();
var helloReturn = Proxies.HelloWorldService.Hello();
var s = Proxies.GoodByeWorldService.GoodBye();
sw.Stop();
avgTimes.Add(sw.Elapsed.Milliseconds);
sw.Reset();
}
sw2.Stop();
var avg = avgTimes.Average();
Console.WriteLine("The Average NEW Service call in mil:" + avg);
Console.WriteLine("total test Time:" + sw2.ElapsedMilliseconds);
Console.WriteLine("Press Any Key to continue");
Console.ReadKey();
runOptions();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.