"Fossies" - the Fresh Open Source Software Archive

Member "ccmath-2.2.1/simu/test/timing/timbran2.c" (23 Nov 2000, 802 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.

    1 /*  timbran2.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;
   12   int i,n,m,k; 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; m=256;
   17   setbran2(s);
   18   st=clock();
   19   for(i=0; i<n ;++i) k=bran2(m);
   20   en=clock();
   21   dt=(en-st)/(double)CLOCKS_PER_SEC;
   22   tms =1.e6*(dt/n);
   23   printf(" %d evaluations in %.3f sec.\n",n,dt);
   24   printf("  %.3e microsec per evaluation\n",tms);
   25 }