{"id":18257135,"url":"https://github.com/yzhong52/simpletimer","last_synced_at":"2025-04-04T18:30:58.620Z","repository":{"id":15515652,"uuid":"18249938","full_name":"yzhong52/SimpleTimer","owner":"yzhong52","description":"A lightweight Timer class in C/C++. Feasible for simple profiling. Compatible with Mac, Linux and Windows.","archived":false,"fork":false,"pushed_at":"2017-06-25T15:30:12.000Z","size":20,"stargazers_count":21,"open_issues_count":0,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-20T16:52:38.884Z","etag":null,"topics":["c-plus-plus","profiler","timer"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"darkoperator/Posh-SSH","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yzhong52.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-03-29T20:20:27.000Z","updated_at":"2024-12-24T18:40:52.000Z","dependencies_parsed_at":"2022-09-16T04:40:19.701Z","dependency_job_id":null,"html_url":"https://github.com/yzhong52/SimpleTimer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yzhong52%2FSimpleTimer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yzhong52%2FSimpleTimer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yzhong52%2FSimpleTimer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yzhong52%2FSimpleTimer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yzhong52","download_url":"https://codeload.github.com/yzhong52/SimpleTimer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247229194,"owners_count":20904998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["c-plus-plus","profiler","timer"],"created_at":"2024-11-05T10:24:57.648Z","updated_at":"2025-04-04T18:30:58.386Z","avatar_url":"https://github.com/yzhong52.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Timer\n======\n\nA lightweight Timer class in C/C++. Feasible for simple profiling. Compatible with Mac, Linux and Windows.\n\n\nUsage\n======\n\nSample Code:\n\n    // Computing PI\n    // Reference: http://mathworld.wolfram.com/PiFormulas.html\n    double func_PI( int n ) {\n        Timer::begin( \"Compute Pi\" ); \n\n        double res = 0;\n        for( int k=1; k\u003cn; k++ ) {\n            res += 4 * pow(-1.0, k+1) / ( 2 * k - 1 ); \n        }\n\n        Timer::end( \"Compute Pi\" ); \n        return res;\n    }\n\n    // Computing Fibonaci number\n    int func_Fibonacci( int n ) {\n        Timer::begin( \"Function Fibonaci\" ); \n\n        int res = 1, tmp = 1;\n        for( int i=0; i\u003cn; i++ ) {\n            tmp = res + tmp; \n            swap( res, tmp ); \n        }\n\n        Timer::end( \"Function Fibonaci\" ); \n        return res;\n    }\n\n\n    int main() {\n        func_PI( 1000000 );\n        func_Fibonacci( 1000000 );\n\n        cout \u003c\u003c Timer::summery() \u003c\u003c endl; \n\n        return 0; \n    }\n\n\nOut put will be:\n\n    +--------------------\n    | Profiling Summery ...\n    +---------------------------------------\n    | Function Name          |                 Total |   Be Called |  Percentage |\n    | Total Run Time         |            14.1279 ms |     1 times |       100 % |\n    | Function Fibonaci      |            4.84595 ms |     1 times |      34.3 % |\n    | Compute Pi             |            9.25415 ms |     1 times |    65.502 % |\n\n# Try It Out\n\nIn terminal, `cd` to the project folder, and type:\n\n    make\n    make run\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyzhong52%2Fsimpletimer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyzhong52%2Fsimpletimer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyzhong52%2Fsimpletimer/lists"}