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

"safe" time in milliseconds since epoch without settings object #165

Open
annevk opened this issue Aug 26, 2024 · 3 comments
Open

"safe" time in milliseconds since epoch without settings object #165

annevk opened this issue Aug 26, 2024 · 3 comments
Assignees

Comments

@annevk
Copy link
Member

annevk commented Aug 26, 2024

I need this concept in Declarative Web Push, but I'm having a hard time figuring out the necessary wording.

@yoavweiss
Copy link
Contributor

If I understand what you need correctly, I think we can define it in a similar way to the current wall time definition, only with the monotonic clock. Would that work?

@annevk
Copy link
Member Author

annevk commented Sep 20, 2024

Well, "current wall time" requires a settings object.

I guess maybe what I need is this:

  1. Let unsafeMonotonicTime be the monotonic clock's unsafe current time.
  2. Return the result of calling coarsen time with unsafeMonotonicTime.

(Because coarsen time takes an optional boolean as second argument that defaults to safe.)

Although maybe the monotonic clock is wrong as it never decreases? I don't know enough about whether I need the wall clock or the monotonic clock. We used to write "time in milliseconds since epoch" but I guess that was never precise enough?

@yoavweiss
Copy link
Contributor

Oh, I think I see the source of confusion here.
We seem to have two different "current wall time" definitions.

A generic one defined as the "result of calling coarsen time with the wall clock's unsafe current time.", which is what I think you want for "time in milliseconds since epoch".

The other one, is attached to a settings object and relies on it.

We should probably rename one of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants