Skip to content

Instantly share code, notes, and snippets.

@toya33
Created August 1, 2013 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save toya33/6132574 to your computer and use it in GitHub Desktop.
Save toya33/6132574 to your computer and use it in GitHub Desktop.
arduinoのサンプリング性能評価用
#include <StandardCplusplus.h>
#include <system_configuration.h>
#include <unwind-cxx.h>
#include <utility.h>
#include <iterator>
#include <vector>
#include <chrono>
#define elements 100
using namespace std;
void setup(){
Serial.begin(9600);
}
void loop(){
vector<int> a(elements);
int i=0;
unsigned long time;
unsigned long span;
time=micros();
for(i=0;i<elements;++i){
a[i]=i;
}
span=micros()-time;
Serial.println(span);
a.clear();
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment