I\'m running elm-repl to play around with the language.
I\'d like to see what the current time is. How would I do that? It doesn\'t appear to be possible with the c
If you want the time as of program start you can do the following:
Now.elm
module Now where
import Native.Now
loadTime : Float
loadTime = Native.Now.loadTime
Native/Now.js
Elm.Native.Now = {};
Elm.Native.Now.make = function(localRuntime) {
localRuntime.Native = localRuntime.Native || {};
localRuntime.Native.Now = localRuntime.Native.Now || {};
if (localRuntime.Native.Now.values) {
return localRuntime.Native.Now.values;
}
var Result = Elm.Result.make(localRuntime);
return localRuntime.Native.Now.values = {
loadTime: (new window.Date).getTime()
};
};
your code
programStart = Now.loadTime