public string Do(string jobName) { try { ICallback callback = OperationContext.Current.GetCallbackChannel <ICallback>(); System.Diagnostics.Stopwatch watcher = new System.Diagnostics.Stopwatch(); watcher.Start(); System.Threading.Thread.Sleep(1000); Console.WriteLine("服务" + AppDomain.CurrentDomain.FriendlyName + "执行任务:" + jobName); watcher.Stop(); callback.Done((int)watcher.ElapsedMilliseconds); return("成功"); } catch { return("失败"); } }