https://github.com/utmhikari/lfunctimer
a hook module for gathering statistics on executing time of functions
https://github.com/utmhikari/lfunctimer
function-profiler lua profiler test testing-tools
Last synced: 5 months ago
JSON representation
a hook module for gathering statistics on executing time of functions
- Host: GitHub
- URL: https://github.com/utmhikari/lfunctimer
- Owner: utmhikari
- Created: 2019-03-24T14:17:06.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-06T11:04:53.000Z (almost 7 years ago)
- Last Synced: 2025-04-03T02:05:06.614Z (10 months ago)
- Topics: function-profiler, lua, profiler, test, testing-tools
- Language: C
- Homepage:
- Size: 16.6 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lfunctimer
a hook module for gathering statistics on executing time of functions
## Installation
`luarocks install --server=http://luarocks.org/manifests/utmhikari lfunctimer`
## examples
examples are in the tests lol~
```lua
local lfunctimer = require "lfunctimer"
lfunctimer.set_config({ key = "value" }) -- set config before start hook
lfunctimer.start() -- set hook on "call"s and "return"s
-- do your stuff
lfunctimer.stop() -- set hook to noop
lfunctimer.print_data() -- print result of function timer
lfunctimer.reset() -- reset lfunctimer.data
```