1 /* Copyright 1999-2004 The Apache Software Foundation
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 /* This is just a quick test program to see how long a wait is
17 * produced by a select loop with an exponential backoff.
19 * gcc -g -O2 -o test_select test_select.c
36 while ((waittime > 0) && (waittime < 3000000)) {
37 printf("%d\n", waittime);
38 tv.tv_sec = waittime/1000000;
39 tv.tv_usec = waittime%1000000;
41 srv = select(0, NULL, NULL, NULL, &tv);