You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.
Hey folks!
I believe it would be quite useful to add a hdk::now() function to the HDK so we can get the current time in the DNA code. We can't use SystemTime in WASM so doing the same kind of wrapper as hdk::sleep() would be enough.
Currently time has to be provided by the UI which is a bit of a useless overhead, and that solution doesn't work for non user-based events like when receiving direct node to node messages.
A quick hack could be to have hdk::sleep() actually return the current time :)
Let me know what you think!
The text was updated successfully, but these errors were encountered:
This is good! I imagine there is going to be some delay between the initial calling of the zome function and the time it gets executed in the wasm, do we care about this?
Agreed!
There is also the timestamp tacked onto headers, but I've seen code that uses those timestamps and it's really quite tricky and ugly, and doesn't cover all use cases at all.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hey folks!
I believe it would be quite useful to add a
hdk::now()
function to the HDK so we can get the current time in the DNA code. We can't use SystemTime in WASM so doing the same kind of wrapper ashdk::sleep()
would be enough.Currently time has to be provided by the UI which is a bit of a useless overhead, and that solution doesn't work for non user-based events like when receiving direct node to node messages.
A quick hack could be to have
hdk::sleep()
actually return the current time :)Let me know what you think!
The text was updated successfully, but these errors were encountered: