我想知道C#中特定服务的CPU使用率。
PerformanceCounter适用于进程:
PerformanceCounter counter = new PerformanceCounter("Process", "% Processor Time", "myprocess", true);
double result = counter.NextValue();
但没有服务:
PerformanceCounter counter = new PerformanceCounter("Service", "% Processor Time", "myservice", true);
double result = counter.NextValue();
答案 0 :(得分:4)
性能计数器的正确名称是
public function postUpdateDescription(UpdateClinicDescriptionFormRequest $request, $id)
{
$clinic = Clinic::find($id);
$clinic->description = Input::get('description');
$clinic->save();
return redirect()->back();
}