1 /*! ========================================================================
2 ** Extended Template and Library Test Suite
6 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
8 ** This package is free software; you can redistribute it and/or
9 ** modify it under the terms of the GNU General Public License as
10 ** published by the Free Software Foundation; either version 2 of
11 ** the License, or (at your option) any later version.
13 ** This package is distributed in the hope that it will be useful,
14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 ** General Public License for more details.
18 ** === N O T E S ===========================================================
20 ** ========================================================================= */
22 /* === H E A D E R S ======================================================= */
27 /* === M A C R O S ========================================================= */
31 /* === C L A S S E S ======================================================= */
34 /* === P R O C E D U R E S ================================================= */
39 fprintf(stderr,"default etl::clock precision: %0.8f\n",etl::clock::precision());
40 fprintf(stderr,"realtime etl::clock precision: %0.8f\n",etl::clock_realtime::precision());
41 fprintf(stderr,"proctime etl::clock precision: %0.8f\n",etl::clock_proctime::precision());
43 etl::clock_realtime timer;
44 etl::clock::value_type amount,total;
46 for(amount=3.0;amount>=0.00015;amount/=2.0)
48 if(amount*1000000.0<1000.0f)
49 fprintf(stderr,"waiting %f microseconds...\n",amount*1000000.0);
50 else if(amount*1000.0<400.0f)
51 fprintf(stderr,"waiting %f milliseconds...\n",amount*1000.0);
53 fprintf(stderr,"waiting %f seconds...\n",amount);
56 etl::clock::sleep(amount);
58 if((total-amount)*1000000.0<1000.0f)
59 fprintf(stderr," ** I waited %f seconds, error of %f microseconds\n",total,(total-amount)*1000000);
60 else if((total-amount)*1000.0<400.0f)
61 fprintf(stderr," ** I waited %f seconds, error of %f milliseconds\n",total,(total-amount)*1000);
63 fprintf(stderr," ** I waited %f seconds, error of %f seconds\n",total,total-amount);
69 /* === E N T R Y P O I N T ================================================= */