time 741 B

123456789101112131415161718192021222324252627
  1. void main() {
  2. long l1 = getMillis();
  3. long l2 = getMillis();
  4. long l3 = getMillis();
  5. long l4 = getMillis();
  6. test(l1 <= l2 && l2 <= l3 && l3 <= l4);
  7. l1 = getNanos();
  8. l2 = getNanos();
  9. l3 = getNanos();
  10. l4 = getNanos();
  11. test(l1 < l2 && l2 < l3 && l3 < l4);
  12. Time time;
  13. long millis = getMillis();
  14. toTime(&time, millis);
  15. test(time.year >= 2021);
  16. test(time.month >= 0 && time.month <= 11);
  17. test(time.day >= 1 && time.day <= 31);
  18. test(time.hours >= 0 && time.hours <= 59);
  19. test(time.minutes >= 0 && time.minutes <= 59);
  20. test(time.seconds >= 0 && time.seconds <= 60);
  21. test(time.millis >= 0 && time.millis <= 999);
  22. test(millis == toMillis(&time));
  23. }