isurakka / HierarchicalProfiler

Simple hierarchical profiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HierarchicalProfiler

Simple hierarchical profiler. Single threaded usage only. Inspired by hprof.

Example usage

var profiler = new HierarchicalProfiler();
profiler.StartFrame("root");

profiler.Enter("update");

profiler.Enter("input");
// update input
profiler.Leave();

profiler.Enter("physics");
// update physics
profiler.Leave();

profiler.Leave();

profiler.Enter("render");
// render everything
profiler.Leave();

profiler.EndFrame();

Inspect profiler.Nodes for profiling results. Nodes are laid linearly.

About

Simple hierarchical profiler

License:Apache License 2.0


Languages

Language:C# 100.0%