This repository has been archived by the owner on Feb 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 269
hdk::now() #2160
Labels
Comments
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? |
I don't if the delay is reasonable. Less than a second lets say. |
This is not hard to implement, I still want to contribute to the project in my spare time so with @zippy 's blessing I could implement this |
Agreed! |
Sign up for free
to 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: