aboutsummaryrefslogtreecommitdiff
path: root/src/libmemdraw/arctest.c
blob: ad7fc326fd4d68c0df58af5910b945705fa1ba82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <u.h>
#include <libc.h>
#include <draw.h>
#include <memdraw.h>

extern int drawdebug;
void
main(int argc, char **argv)
{
	char cc;
	Memimage *x;
	Point c = {208,871};
	int a = 441;
	int b = 441;
	int thick = 0;
	Point sp = {0,0};
	int alpha = 51;
	int phi = 3;
	vlong t0, t1;
	int i, n;
	vlong del;

	memimageinit();

	x = allocmemimage(Rect(0,0,1000,1000), CMAP8);
	n = atoi(argv[1]);

	t0 = nsec();
	t0 = nsec();
	t0 = nsec();
	t1 = nsec();
	del = t1-t0;
	t0 = nsec();
	for(i=0; i<n; i++)
		memarc(x, c, a, b, thick, memblack, sp, alpha, phi, SoverD);
	t1 = nsec();
	print("%lld %lld\n", t1-t0-del, del);
}

int drawdebug = 0;

void
rdb(void)
{
}

int
iprint(char *fmt, ...)
{
	int n;
	va_list va;
	char buf[1024];

	va_start(va, fmt);
	n = doprint(buf, buf+sizeof buf, fmt, va) - buf;
	va_end(va);

	write(1,buf,n);
	return 1;
}