Created
August 1, 2013 15:43
-
-
Save toya33/6132574 to your computer and use it in GitHub Desktop.
arduinoのサンプリング性能評価用
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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