From 09d4c2183a0d29451f24fd60eb6a5164d1c608eb Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 10:04:48 +0000 Subject: Utilisateur : Fcolin Date : 2/06/06 Heure : 16:47 Archivé dans $/CSharp/Ivy/IvyPerf Commentaire: Mise ajour Lib Ivy (vss 9) --- CSharp/Ivy/IvyPerf/IvyPerf.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CSharp/Ivy/IvyPerf/IvyPerf.cs b/CSharp/Ivy/IvyPerf/IvyPerf.cs index db3302e..5cc69d8 100644 --- a/CSharp/Ivy/IvyPerf/IvyPerf.cs +++ b/CSharp/Ivy/IvyPerf/IvyPerf.cs @@ -17,14 +17,14 @@ namespace IvyPerf static double currentTime() // en ms { double time; - time = (double)DateTime.Now.Ticks / (double)TimeSpan.TicksPerMillisecond; + time = (double)(DateTime.Now.Ticks) / (double)(TimeSpan.TicksPerMillisecond); //time = Environment.TickCount; return time; } [IvyBinding("^ping ts=(.*)")] static void Reply(IvyClient client, string[] args) { - bus.sendMsg("pong ts={0} tr={1}", args[0], currentTime() - origin ); + bus.SendMsg("pong ts={0} tr={1}", args[0], currentTime() - origin ); } [IvyBinding("^pong ts=(.*) tr=(.*)")] static void Pong(IvyClient client, string[] args) @@ -51,22 +51,22 @@ namespace IvyPerf my_messsages.Add("pong"); my_messsages.Add("IvyPref"); bus = new Ivy("IvyPerf", "IvyPref ready"); - bus.BindingFilter += new Ivy.ClientRemoveBindingHandler(bus_BindingFilter); + bus.BindingFilter += new EventHandler(bus_BindingFilter); bus.SentMessageClasses = my_messsages; bus.AutoBinding(typeof(IvyPerf)); - bus.start(null); + bus.Start(null); origin = currentTime(); while( true ) { Thread.Sleep( timeout ); - int count = bus.sendMsg("ping ts={0}", currentTime() - origin ); + int count = bus.SendMsg("ping ts={0}", currentTime() - origin ); if ( count == 0 ) Console.Write( "." ); } } - static void bus_BindingFilter(IvyClient app, string arg) + static void bus_BindingFilter(object sender, IvyEventArgs e) { - Console.WriteLine( "The app {0} regexp {1} was Filtred.", app.ApplicationName,arg); + Console.WriteLine( "The app {0} regexp {1} was Filtred.", e.Client.ApplicationName,e.Argument); } } } -- cgit v1.1