Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 BUG: pre-io Date.now() behaviour inconsistent with live runtime #3567

Open
johtso opened this issue Jul 13, 2024 · 2 comments
Open

🐛 BUG: pre-io Date.now() behaviour inconsistent with live runtime #3567

johtso opened this issue Jul 13, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@johtso
Copy link

johtso commented Jul 13, 2024

Which Cloudflare product(s) does this pertain to?

Miniflare

What version(s) of the tool(s) are you using?

wrangler 3.64.0

What version of Node are you using?

v20.14.0

What operating system and version are you using?

Mac Sonoma 14.5

Describe the Bug

Observed behavior

Calling Date.now() before io (for example in the root of a module) returns the current time instead of returning 0 as it does in the live runtime.

Expected behavior

It should behave the same as Date.now() in the live runtime, returning 0

Steps to reproduce

console.log(Date.now()) at the root of any worker and run locally.

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@johtso
Copy link
Author

johtso commented Jul 15, 2024

Actually, think I might have this backwards. If in local development time is supposed to increment regardless of IO, shouldn't performance.now() return the current time, the same as Date.now() when called at the root of a module?

@irvinebroque
Copy link
Contributor

@jasnell

@penalosa penalosa transferred this issue from cloudflare/workers-sdk Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

2 participants