- Timestamp:
- Jan 5, 2020, 9:31:00 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 4834563
- Parents:
- 3c67255
- Location:
- tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/.expect/time.txt
r3c67255 re0c235c 18 18 Dividing that by 2 gives 2403.5 seconds 19 19 4807 seconds is 1 hours, 20 minutes, 7 seconds 20 2020 Jan 5 14:01:40 (GMT) 21 1970 Jan 5 14:00:00 (GMT) 22 1973 Jan 2 06:59:00 (GMT) -
tests/time.cfa
r3c67255 re0c235c 10 10 // Created On : Tue Mar 27 17:24:56 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Nov 29 23:05:30 201913 // Update Count : 2412 // Last Modified On : Sun Jan 5 18:27:37 2020 13 // Update Count : 34 14 14 // 15 15 … … 34 34 sout | t; 35 35 t = t + d1; 36 sout | t | t .tv;36 sout | t | t`ns; 37 37 Time t1 = (timespec){ 104_414, 10_000_000 }; 38 sout | t1 | t1 .tv;39 sout | t - t | t + d5 | t .tv;40 char buf[ 16];38 sout | t1 | t1`ns; 39 sout | t - t | t + d5 | t`ns; 40 char buf[64]; 41 41 sout | "yy/mm/dd" | [t, buf]`ymd | nonl; // shared buf => separate calls 42 42 sout | "mm/dd/yy" | mm_dd_yy( t, buf ) | nonl; … … 45 45 sout | "dd/yy/mm" | [t, buf]`dmy; 46 46 Time t2 = { 2001, 7, 4, 0, 0, 1, 0 }, t3 = (timeval){ 994_219_201 }; 47 sout | t2 | t2 .tv | nl | t3 | t3.tv;47 sout | t2 | t2`ns | nl | t3 | t3`ns; 48 48 sout | nl; 49 49 … … 62 62 sout | "Dividing that by 2 gives" | s / 2 | "seconds"; 63 63 sout | s | "seconds is" | s`h | "hours," | (s % 1`h)`m | "minutes," | (s % 1`m)`s | "seconds"; 64 65 t1 = (Time){ 2020, 1, 5, 9, 0, 0, 100000000000LL }; 66 t2 = (Time){ 1969, 13, 5, 9 }; 67 t3 = (Time){ 1970, 25, 366, 48, 120, -120, 60000000000LL }; 68 strftime( buf, 128, "%Y %b %e %H:%M:%S (GMT)", t1 ); 69 sout | buf; 70 strftime( buf, 128, "%Y %b %e %H:%M:%S (GMT)", t2 ); 71 sout | buf; 72 strftime( buf, 128, "%Y %b %e %H:%M:%S (GMT)", t3 ); 73 sout | buf; 64 74 } // main 65 75
Note: See TracChangeset
for help on using the changeset viewer.