代码拉取完成,页面将自动刷新
// Copyright 2021 the v8go contributors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package v8go
/*
#include "v8go.h"
*/
import "C"
import "time"
type CPUProfile struct {
p *C.CPUProfile
// The CPU profile title.
title string
// root is the root node of the top down call tree.
root *CPUProfileNode
// startTimeOffset is the time when the profile recording was started
// since some unspecified starting point.
startTimeOffset time.Duration
// endTimeOffset is the time when the profile recording was stopped
// since some unspecified starting point.
// The point is equal to the starting point used by startTimeOffset.
endTimeOffset time.Duration
}
// Returns CPU profile title.
func (c *CPUProfile) GetTitle() string {
return c.title
}
// Returns the root node of the top down call tree.
func (c *CPUProfile) GetTopDownRoot() *CPUProfileNode {
return c.root
}
// Returns the duration of the profile.
func (c *CPUProfile) GetDuration() time.Duration {
return c.endTimeOffset - c.startTimeOffset
}
// Deletes the profile and removes it from CpuProfiler's list.
// All pointers to nodes previously returned become invalid.
func (c *CPUProfile) Delete() {
if c.p == nil {
return
}
C.CPUProfileDelete(c.p)
c.p = nil
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。