| 87 | } |
| 88 | |
| 89 | bool Profiler::StopCPUProfiler(Isolate* isolate, const Local<String>& name) { |
| 90 | auto v8prof = CpuProfiler::New(isolate); |
| 91 | auto cpuProfile = v8prof->StopProfiling(name); |
| 92 | |
| 93 | auto success = false; |
| 94 | |
| 95 | if (nullptr != cpuProfile) { |
| 96 | success = Write(cpuProfile); |
| 97 | cpuProfile->Delete(); |
| 98 | } |
| 99 | |
| 100 | return success; |
| 101 | } |
| 102 | |
| 103 | bool Profiler::Write(CpuProfile* cpuProfile) { |
| 104 | struct timespec nowt; |