Exemple #1
0
 private static void Main(string[] args)
 {
     Thread.Sleep(1000);
     try
     {
         var client = new FastClient("127.0.0.1", 16121);
         client.Connect();
         Thread.Sleep(1000);
         while (true)
         {
             DateTime startTime = DateTime.Now;
             for (int i = 0; i < 64000; i++)
             {
                 client.SendMessage("GOOG");
             }
             double seconds = (DateTime.Now - startTime).TotalSeconds;
             Console.WriteLine(seconds);
             Console.WriteLine("MSG/S:" + (64000 / seconds).ToString("0"));
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
     Console.ReadLine();
 }
Exemple #2
0
 private static void Main(string[] args)
 {
     Thread.Sleep(1000);
     try
     {
         var client = new FastClient("127.0.0.1", 16121);
         client.Connect();
         Thread.Sleep(1000);
         Stopwatch sw = new Stopwatch();
         while (!FastClient.Closed)
         {
             sw.Start();
             for (int i = 0; i < 64000; i++)
             {
                 if (FastClient.Closed)
                 {
                     break;
                 }
                 client.SendMessage("GOOG");
             }
             sw.Stop();
             if (!FastClient.Closed)
             {
                 Console.WriteLine(sw.Elapsed.TotalSeconds);
                 Console.WriteLine("MSG/S:" + (64000 / sw.Elapsed.TotalSeconds).ToString("0"));
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
     Console.ReadLine();
 }
 private static void Main(string[] args)
 {
     Thread.Sleep(1000);
     try
     {
         var client = new FastClient("127.0.0.1", 16121);
         client.Connect();
         Thread.Sleep(1000);
         while (true)
         {
             DateTime startTime = DateTime.Now;
             for (int i = 0; i < 64000; i++)
             {
                 client.SendMessage("GOOG");
             }
             double seconds = (DateTime.Now - startTime).TotalSeconds;
             Console.WriteLine(seconds);
             Console.WriteLine("MSG/S:" + (64000/seconds).ToString("0"));
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
     Console.ReadLine();
 }