1 Star 0 Fork 0

似是故人来/v8go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
cpuprofile.go 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
zhengkaikai 提交于 2022-07-22 21:31 +08:00 . 包名
// 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
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/hasika/v8go.git
[email protected]:hasika/v8go.git
hasika
v8go
v8go
master

搜索帮助