Title: [fork-ffi] purescript-lua-console: implement console timers (time/timeLog/timeEnd) · Issue #2 · purescript-lua/purescript-lua-console · GitHub
Open Graph Title: [fork-ffi] purescript-lua-console: implement console timers (time/timeLog/timeEnd) · Issue #2 · purescript-lua/purescript-lua-console
X Title: [fork-ffi] purescript-lua-console: implement console timers (time/timeLog/timeEnd) · Issue #2 · purescript-lua/purescript-lua-console
Description: The Effect.Console timer functions are stubbed out. time, timeLog and timeEnd all raise "Sorry, console timers aren't implemented yet" and ignore their label argument (src/Effect/Console.lua). On the JS backend these map to console.time(...
Open Graph Description: The Effect.Console timer functions are stubbed out. time, timeLog and timeEnd all raise "Sorry, console timers aren't implemented yet" and ignore their label argument (src/Effect/Console.lua). On t...
X Description: The Effect.Console timer functions are stubbed out. time, timeLog and timeEnd all raise "Sorry, console timers aren't implemented yet" and ignore their label argument (src/Effect/Cons...
Opengraph URL: https://github.com/purescript-lua/purescript-lua-console/issues/2
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[fork-ffi] purescript-lua-console: implement console timers (time/timeLog/timeEnd)","articleBody":"The `Effect.Console` timer functions are stubbed out. `time`, `timeLog` and `timeEnd` all raise `\"Sorry, console timers aren't implemented yet\"` and ignore their label argument (`src/Effect/Console.lua`). On the JS backend these map to `console.time(label)` / `console.timeLog(label)` / `console.timeEnd(label)`: a named timer keyed by the label string, used to measure elapsed time.\n\nThis issue tracks giving them a real implementation. The lint noise from the unused label was already handled in #64 by renaming the parameter to `_s`; this is the follow-up feature work.\n\n## Sketch\n\nKeep a module-level table of start times keyed by label and read the clock on each call:\n\n```lua\nlocal timers = {}\n-- time(label): timers[label] = os.clock()\n-- timeLog(label): print(label .. \": \" .. (os.clock() - timers[label]) * 1000 .. \"ms\")\n-- timeEnd(label): same as timeLog, then timers[label] = nil\n```\n\n## Caveat to decide\n\nStock Lua 5.1 has no millisecond wall-clock. `os.clock` returns CPU seconds, not wall time, and `os.time` is whole seconds. So the output cannot match the JS `console.time` semantics exactly. Options: accept `os.clock` (CPU time) and document the divergence, depend on a wall-clock source like `socket.gettime` where available, or keep the stubs and close this as won't-fix. The right call depends on whether downstream code relies on these for real timing or just for parity with the JS API surface.\n","author":{"url":"https://github.com/Unisay","@type":"Person","name":"Unisay"},"datePublished":"2026-06-14T15:17:14Z","url":"https://github.com/purescript-lua/purescript-lua-console/issues/2"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b68232cf-3ac6-dfed-26a6-f1f947588d4b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 924C:63875:69E503:8E4306:6B00D60D |
| html-safe-nonce | daf8fd44e120d530ba9925d42923394181f3d92d33a181fd8b4caa94fa0f5b0b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjRDOjYzODc1OjY5RTUwMzo4RTQzMDY6NkIwMEQ2MEQiLCJ2aXNpdG9yX2lkIjoiNTAyODIzMTc5OTkyNzUyNjkyNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0022a70c4a36bbb936363435737d7e7085a410c1ef118e213d18f7b249f157e7 |
| hovercard-subject-tag | issue:4659577571 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/purescript-lua/purescript-lua-console/2/issue_layout |
| twitter:image | https://opengraph.githubassets.com/afa34fc657a1f6ec5e83a347085b3c63435623e7ce9f881cbb5a22166a3ecc2b/purescript-lua/purescript-lua-console/issues/2 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/afa34fc657a1f6ec5e83a347085b3c63435623e7ce9f881cbb5a22166a3ecc2b/purescript-lua/purescript-lua-console/issues/2 |
| og:image:alt | The Effect.Console timer functions are stubbed out. time, timeLog and timeEnd all raise "Sorry, console timers aren't implemented yet" and ignore their label argument (src/Effect/Console.lua). On t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Unisay |
| hostname | github.com |
| expected-hostname | github.com |
| None | a481f62a1e04c9b9bdcb5628230682c66d59006f5b13b080f79cba84a176905b |
| turbo-cache-control | no-preview |
| go-import | github.com/purescript-lua/purescript-lua-console git https://github.com/purescript-lua/purescript-lua-console.git |
| octolytics-dimension-user_id | 131581790 |
| octolytics-dimension-user_login | purescript-lua |
| octolytics-dimension-repository_id | 620993762 |
| octolytics-dimension-repository_nwo | purescript-lua/purescript-lua-console |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 33839300 |
| octolytics-dimension-repository_parent_nwo | purescript/purescript-console |
| octolytics-dimension-repository_network_root_id | 33839300 |
| octolytics-dimension-repository_network_root_nwo | purescript/purescript-console |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 84c8c5cc25e2fb7f2308428458538436baecc6d2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width