System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch(); sw.Start(); postDept = GetNodeDept(post.DepartmentID); sw.Stop(); TimeSpan ts = sw.Elapsed; PageAlertMsg("时间为:"+ts.TotalMilliseconds);