-
Notifications
You must be signed in to change notification settings - Fork 200
Expand file tree
/
Copy pathptest001.cpp
More file actions
41 lines (32 loc) · 834 Bytes
/
Copy pathptest001.cpp
File metadata and controls
41 lines (32 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// ptest001.cpp - file load and get data by column, row and cell
#include <rapidcsv.h>
#include "perftest.h"
#include "unittest.h"
int main()
{
int rv = 0;
try
{
perftest::Timer timer;
for (int i = 0; i < 10; ++i)
{
timer.Start();
rapidcsv::Document doc("../tests/msft.csv", rapidcsv::LabelParams(0, 0));
const std::vector<double>& column = doc.GetColumn<double>("Close");
const std::vector<double>& row = doc.GetRow<double>("2016-05-23");
const double cell = doc.GetCell<double>("Close", "2016-05-23");
timer.Stop();
// dummy usage of variables
(void)column;
(void)row;
(void)cell;
}
timer.ReportMedian();
}
catch (const std::exception& ex)
{
std::cout << "exception: " << ex.what() << std::endl;
rv = 1;
}
return rv;
}