benchmark.c
Go to the documentation of this file.
1 /******************************************************************************/
35 /******************************************************************************/
36 
37 #include "benchmark.h"
38 
39 void
41  void
42 ) {
44  time_counter = millis();
45 }
46 
47 void
49  void
50 ) {
51  unsigned int ram_used = ram_counter - free_ram() - 4; /* Magic offset - compensates for benchmark requiring 4 bytes to work */
52  unsigned int time_elapsed = millis() - time_counter;
53 
54  printf("%db RAM use in %dms.\n", ram_used, time_elapsed);
55 }
static unsigned volatile int ram_counter
Definition: benchmark.h:48
void benchmark_start(void)
Definition: benchmark.c:40
#define printf(format,...)
int free_ram()
Definition: ram_util.c:40
Header file for benchmarking.
static unsigned volatile int time_counter
Definition: benchmark.h:49
void benchmark_stop(void)
Definition: benchmark.c:48