Alien-Judy

 view release on metacpan or  search on metacpan

src/judy-1.0.5/src/apps/demo/funhist.c  view on Meta::CPAN

// sorted list at the same time.
// Also notice that JudyLCount is much faster than you can sequentially
// count items in an array.
//

#include <stdlib.h>     // random()
#include <stdio.h>      // printf()
#include <sys/time.h>   // gettimeofday()
#include <Judy.h>       // JL*() routines

// Default number of iterations (number of random numbers generated)
// This may be overridden on the command line

#define DEFAULT_ITER 1000000

// The number of buckets the histogram is divided into.

#define DEFAULT_HISTO_BUCKETS 32

// Macro for correction english output for plurals

src/judy-1.0.5/test/timeit.c  view on Meta::CPAN

	TIMER_vars(tm1);	// overall timer variables.
	TIMER_vars(tm2);	// misc + loop timer variables.


// INITIALIZE:

	STARTTm(tm1);		// whole program timer.

	i_max += preload;

// The first arg is the number of iterations (default is i_max):

	if (argc > 1)
	{
	    i = atoi(argv[1]) + preload;
	    if (i > 0) i_max = (long)i;
	}

// Calculate timer overhead (ztime):

#ifdef _TIMEIT_HIGHRES



( run in 2.315 seconds using v1.01-cache-2.11-cpan-71847e10f99 )