{"id":19039615,"url":"https://github.com/windwalker-io/profiler","last_synced_at":"2026-03-19T07:50:44.553Z","repository":{"id":21109580,"uuid":"24410075","full_name":"windwalker-io/profiler","owner":"windwalker-io","description":"[READ ONLY] A profiler object to monitor system running information.","archived":false,"fork":false,"pushed_at":"2021-02-18T07:03:01.000Z","size":56,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-21T15:09:09.408Z","etag":null,"topics":["debug","debugger","profiler"],"latest_commit_sha":null,"homepage":"https://github.com/ventoviro/windwalker","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/windwalker-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-24T10:06:17.000Z","updated_at":"2024-12-16T13:49:30.000Z","dependencies_parsed_at":"2022-08-25T14:41:26.307Z","dependency_job_id":null,"html_url":"https://github.com/windwalker-io/profiler","commit_stats":null,"previous_names":["ventoviro/windwalker-profiler"],"tags_count":79,"template":false,"template_full_name":null,"purl":"pkg:github/windwalker-io/profiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windwalker-io%2Fprofiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windwalker-io%2Fprofiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windwalker-io%2Fprofiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windwalker-io%2Fprofiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/windwalker-io","download_url":"https://codeload.github.com/windwalker-io/profiler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/windwalker-io%2Fprofiler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29506768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debug","debugger","profiler"],"created_at":"2024-11-08T22:17:54.918Z","updated_at":"2026-02-16T11:35:57.794Z","avatar_url":"https://github.com/windwalker-io.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Windwalker Profiler\n\nWindwalker Profiler can help us profiler some process information for debug.\n\n## Installation via Composer\n\nAdd this to the require block in your `composer.json`.\n\n``` json\n{\n    \"require\": {\n        \"windwalker/profiler\": \"~3.0\"\n    }\n}\n```\n\n## Create A Profiler And Mark A Point\n\n``` php\nuse Windwalker\\Profiler\\Profiler;\n\n$profiler = new Profiler;\n\n$profiler-\u003emark('StartRender');\n\n// Execute some code...\n\n$profiler-\u003emark('AfterRender');\n\n// Execute some code...\n\n$profiler-\u003emark('End');\n```\n\nNow your can get the elapsed time between two points:\n\n``` php\n$profiler-\u003egetTimeBetween('StartRender', 'AfterRender');\n```\n\nOr get memory amount between two points:\n\n``` php\n// Return memory bytes\n$profiler-\u003egetMemoryBetween('StartRender', 'AfterRender');\n```\n\n## Output Result\n\n``` php\necho $profiler-\u003erender();\n```\n``` php\nNotes 0.000 seconds (+0.000); 0.00 MB (+0.000) - StartRender\nNotes 1.000 seconds (+1.000); 3.00 MB (+3.000) - AfterRender\nNotes 1.813 seconds (+0.813); 6.24 MB (+3.240) - End\n```\n\n## Benchmark\n\nBenchmark is a convenience object to test two or more tasks executing time.\n\n``` php\nuse Windwalker\\Profiler\\Banchmark;\n\n$benchmark = new Benchmark;\n\n$benchmark-\u003eaddTask('task1', function()\n{\n    md5(uniqid());\n})\n-\u003eaddTask('task2', function()\n{\n    sha1(uniqid());\n});\n\n$benchmark-\u003eexecute(10000);\n\necho $benchmark-\u003erender();\n```\n\nThe output\n\n```\ntask1 =\u003e 0.204897 s\ntask2 =\u003e 0.205108 s\n```\n\nUse Other format\n\n``` php\n$benchmark-\u003esetTimeFormat(Benchmark::MILLI_SECOND)-\u003eexecute(10000);\n\necho $benchmark-\u003erender();\n\n/* Result\ntask1 =\u003e 187.489986 ms\ntask2 =\u003e 207.049847 ms\n*/\n```\n\n``` php\n$benchmark-\u003esetTimeFormat(Benchmark::MICRO_SECOND)-\u003eexecute(10000);\n\necho $benchmark-\u003erender();\n\n/* Result\ntask1 =\u003e 198050.9758 μs\ntask2 =\u003e 206343.173981 μs\n*/\n```\n\n### Custom Render Handler\n\n``` php\n$benchmark-\u003esetRenderOneHandler(function($name, $result, $round, $format)\n{\n    return $name . ' : ' . round($result, $round);\n});\n\n$benchmark-\u003erender();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindwalker-io%2Fprofiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwindwalker-io%2Fprofiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwindwalker-io%2Fprofiler/lists"}