diff 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 diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.c	Tue Jun 10 16:18:50 2025 -0400
@@ -0,0 +1,29 @@
+#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;
+}