Standard library / runtime
runtime.BlockProfileRecord
Record of sampled blocking events: Count, Cycles and embedded StackRecord. The promoted Stack method reads the embedded stack; cycles are not nanoseconds. Expected stdout: '3 2\n'.
Formal Syntax & Structure
go syntaxgo
type BlockProfileRecord struct { Count int64 Cycles int64 StackRecord}Working Example
Example Snippetgo
package main
import ( "fmt" "runtime")
func main() { r := runtime.BlockProfileRecord{Count: 3, Cycles: 10, StackRecord: runtime.StackRecord{Stack0: [32]uintptr{1, 2}}} fmt.Println(r.Count, len(r.Stack()))}