https://github.com/ppekko/uniprofile
C++17 Cross platform profiler
https://github.com/ppekko/uniprofile
header-only profiler
Last synced: 9 months ago
JSON representation
C++17 Cross platform profiler
- Host: GitHub
- URL: https://github.com/ppekko/uniprofile
- Owner: ppekko
- License: mit
- Created: 2022-04-17T14:39:42.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-06-15T20:56:54.000Z (almost 3 years ago)
- Last Synced: 2024-11-15T04:41:34.753Z (over 1 year ago)
- Topics: header-only, profiler
- Language: C++
- Homepage:
- Size: 204 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# uniprofile
A C++17 Header-Only, crossplatform and easy to implement profiler for applications.
Licensed under the MIT license.
[Download here.](https://github.com/pipe/uniprofile/blob/master/include/uniprofile.h)
# Usage
As detailed in the header itself, make sure to define `#define UNIPROFILER_IMPLEMENTATION` before including it to create the implementation. (also define `#define UNIPROFILER_DEBUGTEXT` for debug text).
As for code, you will need to set a callback to a function that will return the time in seconds with `.setTimerFetchCallBack()` (such as `glfwGetTime()`). Then at any point in the program, you can start profiling a function/process with `.startProfile()` and `.endProfile()`. You can the name of the profile as an argument (make sure they are the same in both functions!).
To dump all the profiling info into a file, run `.dumpAllProfiles()`, with the file location being the argument.
[You can view the example project to get a better understanding on how to implement this library](https://github.com/ppekko/uniprofile/blob/master/example/)
# Why C++17
im lazy and i dont want to implement my own sorting algorithm, so im using std::sort.