json/benchmark/JSON_benchmark.cc

18 lines
351 B
C++
Raw Normal View History

2013-12-11 09:50:50 +00:00
#include <iostream>
#include <fstream>
2013-12-11 12:23:50 +00:00
#include <ctime>
2013-12-11 09:50:50 +00:00
#include <JSON.h>
int main(int argc, char** argv) {
2013-12-11 12:23:50 +00:00
time_t timer1, timer2;
2013-12-11 09:50:50 +00:00
JSON json;
std::ifstream infile(argv[1]);
2013-12-11 12:23:50 +00:00
time(&timer1);
2013-12-11 09:50:50 +00:00
json << infile;
2013-12-11 12:23:50 +00:00
time(&timer2);
std::cout << "Parsing from std::ifstream: " << difftime(timer2, timer1) << " sec\n";
2013-12-11 09:50:50 +00:00
return 0;
}