Re: [cc65] Benchmarks

From: Markus Stehr <>
Date: 2009-09-03 17:22:14

Something very simple, just adding up longs:

--------------------------<PUT CHAINSAW HERE>---------------------
#include <stdio.h>
#include <time.h>

void main(void)
	unsigned long a,b;
	unsigned int i,j;
	clock_t starttime,endtime;

	starttime = clock();
	// Bench starts here
		a = 2;
		b = 1;
			b = b + a;
			a = b;
			//printf("j:%d a:%ld\n",j,a);
	// Bench ends here
	endtime = clock();

	printf("Time in system ticks:%ld\n",endtime-starttime);
	printf("Time in seconds:%ld\n",(endtime-starttime)/CLOCKS_PER_SEC);
--------------------------<PUT CHAINSAW HERE>---------------------

Hope it helps :)

My results:
bastetfurry@katzenrechner:~/projekte$ cc65 --version
cc65 V2.12.9
cc65: No input files

Results on a C64 (VICE):
Time in system ticks:371
Time in seconds:6

And for the records, GCC4.3.3 whines about main not being int. ;)


To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Sep 3 17:22:24 2009

This archive was generated by hypermail 2.1.8 : 2009-09-03 17:22:26 CEST