"Fossies" - the Fresh Open Source Software Archive

Member "ccmath-2.2.1/simu/test/timing/timnrml.c" (23 Nov 2000, 806 Bytes) of package /linux/misc/old/ccmath-2.2.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "timnrml.c" see the Fossies "Dox" file reference documentation.

    1 /*  timnrml.c    CCMATH mathematics library source code.
    2  *
    3  *  Copyright (C)  2000   Daniel A. Atkinson    All rights reserved.
    4  *  This code may be redistributed under the terms of the GNU library
    5  *  public license (LGPL). ( See the lgpl.license file for details.)
    6  * ------------------------------------------------------------------------
    7  */
    8 #include <time.h>
    9 #include "ccmath.h"
   10 void main(int na,char **av)
   11 { unsigned int s; double e;
   12   int i,n; clock_t st,en;
   13   double dt,tms;
   14   if(na!=2){ printf("para: count\n"); exit(1);}
   15   n=atoi(*++av);
   16   s=0x5a7d3b28;
   17   setnrml(s);
   18   st=clock();
   19   for(i=0; i<n ;++i) e=nrml();
   20   en=clock();
   21   dt=(en-st)/(double)CLOCKS_PER_SEC;
   22   tms =1.0e6*(dt/(double)n);
   23   printf(" %d evaluations in %.3f sec.\n",n,dt);
   24   printf("  %.3e microsec per evaluation\n",tms);
   25 }