sleeputil.myr 310 B

1234567891011121314151617181920
  1. use std
  2. use "dispatch"
  3. const sleeputil = {params
  4. var sn
  5. std.put("sleep called\n")
  6. std.put("s.\n")
  7. sn=params[0]
  8. match std.intparse(sn)
  9. | `std.Some n: std.usleep(n*std.Msec)
  10. | `std.None: std.put("{}\n","wrong value")
  11. ;;
  12. std.put("f.\n")
  13. }
  14. const __init__ = {
  15. dispatch.register("sleep",sleeputil)
  16. }