{"id":16231504,"url":"https://github.com/hustcc/page-fps","last_synced_at":"2025-03-19T14:30:39.732Z","repository":{"id":57318017,"uuid":"180298065","full_name":"hustcc/page-fps","owner":"hustcc","description":":framed_picture: Inject fps indicator into your page for web performance.","archived":false,"fork":false,"pushed_at":"2019-05-27T01:50:41.000Z","size":14,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T07:51:27.025Z","etag":null,"topics":["benchmark","fps","perf"],"latest_commit_sha":null,"homepage":"https://git.hust.cc/page-fps/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hustcc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-09T06:17:14.000Z","updated_at":"2020-12-10T03:02:26.000Z","dependencies_parsed_at":"2022-08-25T20:40:31.533Z","dependency_job_id":null,"html_url":"https://github.com/hustcc/page-fps","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Fpage-fps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Fpage-fps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Fpage-fps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Fpage-fps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hustcc","download_url":"https://codeload.github.com/hustcc/page-fps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244444441,"owners_count":20453724,"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":["benchmark","fps","perf"],"created_at":"2024-10-10T13:05:48.978Z","updated_at":"2025-03-19T14:30:39.488Z","avatar_url":"https://github.com/hustcc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# page-fps\n\n\u003e Inject fps indicator into your page.\n\n\n[![npm](https://img.shields.io/npm/v/page-fps.svg)](https://www.npmjs.com/package/page-fps)\n[![npm](https://img.shields.io/npm/dm/page-fps.svg)](https://www.npmjs.com/package/page-fps)\n[![gzip](http://img.badgesize.io/https://unpkg.com/page-fps/dist/pf.min.js?compression=gzip)](https://unpkg.com/page-fps/dist/pf.min.js)\n\n\n\n## Install\n\n\u003e npm i --save page-fps\n\n\n\n## Usage\n\n\n - Code usage\n\n```js\nimport PF from 'page-fps';\n\nconst pf = new PF();\n\n// start\npf.start();\n\n// stop\npf.stop();\n```\n\n\n - Script usage\n\nJust import `dist/entry.min.js` into your document with script tag.\n\n\n\n## API\n\n\n```ts\nimport PF from 'page-fps';\nimport { FPS, Timer } from 'page-fps'\n```\n\n - `PF`: page fps indicator.\n\n - `FPS`: a fps collector.\n \n```ts\nimport { FPS } from 'page-fps';\n\nconst fps = new FPS();\n\n// 开始记录数据\nfps.start();\n\n// 计算当前 fps\nconst f = fps.sample();\n\n// 停止记录数据\nfps.stop();\n```\n\n - `Timer`: a callback execute timer.\n\n```ts\nimport { Timer } from 'page-fps';\n\nconst timer = new Timer(callback, 30);\n\n// 每隔 30ms 执行一次 callback 方法\ntimer.start();\n\n// 停止\ntimer.stop();\n```\n\n\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Fpage-fps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhustcc%2Fpage-fps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Fpage-fps/lists"}