view main.c @ 0:9ee92e7a1cb5 default tip

*: initial commit this is a very simple, bare-bones randomness API. if the system can't provide it, so be it -- init will fail.
author Paper <paper@tflc.us>
date Tue, 10 Jun 2025 16:18:50 -0400
parents
children
line wrap: on
line source

#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <time.h>

#include "librandom.h"

int main(void)
{
	clock_t start, end;
	int i;
	uint32_t x;
	struct random r;

	random_init(&r);

	start = clock();

	for (i = 0; i < 1000000; i++)
		random_read(&r, &x, sizeof(x));

	end = clock();

	printf("%f\n", (double)(end - start) / CLOCKS_PER_SEC);

	random_close(&r);

	return 0;
}