diff options
| author | Colin Davidson <colrdavidson@gmail.com> | 2023-03-09 16:05:16 -0800 |
|---|---|---|
| committer | Colin Davidson <colrdavidson@gmail.com> | 2023-03-09 16:05:16 -0800 |
| commit | 6f4f2754d6a8106bc922765d3006b6cce615d124 (patch) | |
| tree | 437600f0815694dd2dd5b2a00c17765562ec699e /core/prof | |
| parent | 30ced041376fcfe6684f72f45ef16c335b8ed89d (diff) | |
add basic usage example
Diffstat (limited to 'core/prof')
| -rw-r--r-- | core/prof/spall/doc.odin | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/core/prof/spall/doc.odin b/core/prof/spall/doc.odin new file mode 100644 index 000000000..a04c9e420 --- /dev/null +++ b/core/prof/spall/doc.odin @@ -0,0 +1,24 @@ +/* +import "core:prof/spall" + +spall_ctx: spall.Context +spall_buffer: spall.Buffer + +foo :: proc() { + spall.SCOPED_EVENT(&spall_ctx, &spall_buffer, #procedure) +} + +main :: proc() { + spall_ctx = spall.context_create("trace_test.spall") + defer spall.context_destroy(&spall_ctx) + + buffer_backing := make([]u8, spall.BUFFER_DEFAULT_SIZE) + spall_buffer = spall.buffer_create(buffer_backing) + defer spall.buffer_destroy(&spall_ctx, &spall_buffer) + + for i := 0; i < 9001; i += 1 { + foo() + } +} +*/ +package spall |