Skip to content
Snippets Groups Projects
Commit 1aef072c authored by Neil Gershenfeld's avatar Neil Gershenfeld
Browse files

add ESP32

parent b9c44f83
Branches
No related tags found
No related merge requests found
Pipeline #9875 passed
/*
* pi.ino
* Neil Gershenfeld 12/20/20
* pi calculation benchmark
* pi = 3.14159265358979323846
*/
#define NPTS 1000000
int i;
double a,b,c,pi,dt,mflops;
unsigned long tstart,tend;
void setup() {
Serial.begin(115200);
}
void loop() {
tstart = millis();
a = 0.5;
b = 0.75;
c = 0.25;
pi = 0;
for (i = 1; i <= NPTS; ++i)
pi += a/((i-b)*(i-c));
tend = millis();
dt = (tend-tstart)/1000.0;
mflops = NPTS*5.0/(dt*1e6);
printf("NPTS = %d, pi = %f\n",NPTS,pi);
printf("time = %f, estimated MFlops = %f\n",dt,mflops);
}
......@@ -36,6 +36,7 @@
|0.47|[numpi.py](Python/numpi.py)|Python, NumPy|Intel i7-8700T|November, 2018|
|0.074|[pi.c](C/pi.c)|C<br>gcc pi.c -o pi -lm -O3 -ffast-math|Raspberry Pi Zero|December, 2020|
|0.029|[pi.py](Python/pi.py)|Python|Intel i7-8700T|November, 2018|
|0.001|[pi.ino](Arduino/pi.ino)|Arduino|ESP32-WROOM|December, 2020|
|estimated GFlops|estimated GFlops/W|code|description|system|date|
|---|---|---|---|---|---|
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment