~aleteoryx/9c

c2481f8399afb47057888c25a588f0f88d2ce826 — glenda 37 years ago ad26e5a
spiral start + cpu bench
2 files changed, 25 insertions(+), 1 deletions(-)

M mkfile
A spiral.c
M mkfile => mkfile +2 -1
@@ 2,7 2,8 @@

bins=\
	pong\
	maze
	maze\
	spiral

all:VQ: $bins


A spiral.c => spiral.c +23 -0
@@ 0,0 1,23 @@
#include <u.h>
#include  <libc.h>
#include  <draw.h>
#include  <event.h>
#include  <cursor.h>

void
main(void)
{
	double start, end;
	double lastcos;

	lastcos = 1.0;

	start = cputime();
	for (int i = 0; i < 100000000; i++)
	{
		lastcos = cos(lastcos) + 1.0;
	}
	end = cputime();

	print("Calculating 100,000,000 cosines took %fs\n", end - start);
}