ast-experimental
Last change
on this file since 8463136 was
8cb06b6,
checked in by caparsons <caparson@…>, 15 months ago
|
added waituntil timeout test and added waituntil test that uses multiple waituntil primitive types
|
-
Property mode set to
100644
|
File size:
656 bytes
|
Line | |
---|
1 | #include <time.hfa> |
---|
2 | #include <alarm.hfa> |
---|
3 | #include <select.hfa> |
---|
4 | #include <stdbool.h> |
---|
5 | #include <stdio.h> |
---|
6 | |
---|
7 | int main() { |
---|
8 | waituntil( sleep( 1`ms ) ) { printf("timeout\n"); } |
---|
9 | waituntil( timeout( 1`s ) ) { printf("timeout\n"); } or waituntil( timeout( 2`s ) ) { printf("timeout\n"); } |
---|
10 | waituntil( timeout( 100`s ) ) { printf("timeout 1\n"); } or else { printf("else\n"); } |
---|
11 | waituntil( timeout( 1`ns ) ) { printf("timeout\n"); } and waituntil( timeout( 2`s ) ) { printf("timeout\n"); } |
---|
12 | int count = 0; |
---|
13 | for ( i; 1000 ) |
---|
14 | waituntil( timeout( 1`ns ) ) { count++; } or else { count++; } |
---|
15 | |
---|
16 | assert( count == 1000 ); |
---|
17 | printf("done\n"); |
---|
18 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.