Replies: 5 comments
-
Does |
Beta Was this translation helpful? Give feedback.
-
It will. I'm working on a cross-platform project so using a standard API is more attractive. Also, I like to shout about XS's 262 scores in my talks so I'm also expecting to get a suitable Temporal disclaimer here. Shimming Temporal.Now.instant in my library is totally an option for me though. |
Beta Was this translation helpful? Give feedback.
-
Got it. Note, however, that Temporal may not be the best solution for you. As far as I can tell, it represents "wall clock time" which can undergo unexpected events, such as being set forward or backwards, or slewed to make up for inaccuracies. The ESP-IDF does do a pretty good job at slewing the clock but other devices may simply reset every time they sync with NTP over wifi or the host over USB... Time.microseconds is based on a "free running" CPU clock oscillator and remains stable except for minor temperature variations. It cannot be set/reset or slewed. IMHO, for stuff like motor control this makes Time.microsecond a much better base than any wall-clock timebase. |
Beta Was this translation helpful? Give feedback.
-
Temporal has been at Stage 3 for some time. It is a huge proposal, perhaps the biggest ever. It is not yet available in browsers, as far as I know. If it finds it way to embedded, it will likely be a subset. Fortunately, if what you need is a higher resolution time source, you can use the microseconds property available as an extension to the Time module. |
Beta Was this translation helpful? Give feedback.
-
Isn't there a web performance API that provides microseconds (or better) accuracy? Maybe that would be a better target for a cross platform API than Temporal. |
Beta Was this translation helpful? Give feedback.
-
With temporal at stage 3, I'm curious if there is a plan to implement it in XS. My use case is controlling stepper motors, and the only thing I really care about is Temporal.Now.instant.
With millisecond timing, steppers will drift off their scheduled move time if their step speed is not a factor of 1000. If I perform a "catch-up" step while moving, there can be a noticeable "thunk" when I double up steps.
I'm sure it's a resource issue, and I get that, but figured it couldn't hurt to ask.
Beta Was this translation helpful? Give feedback.
All reactions