source:
CIVL/mods/dev.civl.com/examples/library/time/timeTest.cvl@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 318 bytes | |
| Rev | Line | |
|---|---|---|
| [114493e] | 1 | #include <civlc.cvh> |
| 2 | #include <time.h> | |
| 3 | #include <stdio.h> | |
| 4 | ||
| 5 | $input int N;//number of processes | |
| 6 | ||
| 7 | void proc(int id){ | |
| 8 | time_t mytime = time(NULL); | |
| 9 | ||
| 10 | printf("Time of process %d is %f\n", id, mytime); | |
| 11 | } | |
| 12 | ||
| 13 | int main(){ | |
| 14 | $proc procs[N]; | |
| 15 | ||
| 16 | for(int i = 0; i < N; i++) | |
| 17 | procs[i] = $spawn proc(i); | |
| 18 | $waitall(procs, N); | |
| 19 | } |
Note:
See TracBrowser
for help on using the repository browser.
