arctest.c 865 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #include <u.h>
  2. #include <libc.h>
  3. #include <draw.h>
  4. #include <memdraw.h>
  5. #include <memlayer.h>
  6. extern int drawdebug;
  7. void
  8. main(int argc, char **argv)
  9. {
  10. char cc;
  11. Memimage *x;
  12. Point c = {208,871};
  13. int a = 441;
  14. int b = 441;
  15. int thick = 0;
  16. Point sp = {0,0};
  17. int alpha = 51;
  18. int phi = 3;
  19. vlong t0, t1;
  20. int i, n;
  21. vlong del;
  22. memimageinit();
  23. x = allocmemimage(Rect(0,0,1000,1000), CMAP8);
  24. n = atoi(argv[1]);
  25. t0 = nsec();
  26. t0 = nsec();
  27. t0 = nsec();
  28. t1 = nsec();
  29. del = t1-t0;
  30. t0 = nsec();
  31. for(i=0; i<n; i++)
  32. memarc(x, c, a, b, thick, memblack, sp, alpha, phi, SoverD);
  33. t1 = nsec();
  34. print("%lld %lld\n", t1-t0-del, del);
  35. }
  36. int drawdebug = 0;
  37. void
  38. rdb(void)
  39. {
  40. }
  41. int
  42. iprint(char *fmt, ...)
  43. {
  44. int n;
  45. va_list va;
  46. char buf[1024];
  47. va_start(va, fmt);
  48. n = doprint(buf, buf+sizeof buf, fmt, va) - buf;
  49. va_end(va);
  50. write(1,buf,n);
  51. return 1;
  52. }