summaryrefslogtreecommitdiff
path: root/tests/millis.ur
diff options
context:
space:
mode:
Diffstat (limited to 'tests/millis.ur')
-rw-r--r--tests/millis.ur17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/millis.ur b/tests/millis.ur
new file mode 100644
index 00000000..0ba22b9f
--- /dev/null
+++ b/tests/millis.ur
@@ -0,0 +1,17 @@
+fun diffThem tm =
+ tm' <- now;
+ return <xml><body>
+ Diff: {[diffInMilliseconds tm tm']}
+ </body></xml>
+
+fun main () : transaction page =
+ tm <- now;
+
+ return <xml><body>
+ Now: {[toMilliseconds tm]}<br/>
+ <a link={diffThem tm}>Diff</a><br/>
+
+ <button onclick={tm' <- now;
+ alert ("Now: " ^ show (toMilliseconds tm'));
+ alert ("Diff: " ^ show (diffInMilliseconds tm tm'))}/>
+ </body></xml>