view tests/millis.ur @ 2262:34ad83d9b729

Fix recording bugs to do with nesting and buffer reallocation. Stop MonoFooify printing spurious errors.
author Ziv Scully <ziv@mit.edu>
date Wed, 07 Oct 2015 08:58:08 -0400
parents 225b87d4a7df
children
line wrap: on
line source
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>