change benchmark call away from removed cell method, fix benchmark warnings

This commit is contained in:
Thomas Fussell 2017-03-21 19:14:27 -04:00
parent f6626e5079
commit c448536e38
2 changed files with 7 additions and 11 deletions

View File

@ -6,7 +6,7 @@
std::size_t current_time()
{
return std::chrono::duration<double, std::milli>(std::chrono::system_clock::now().time_since_epoch()).count();
return static_cast<std::size_t>(std::chrono::duration<double, std::milli>(std::chrono::system_clock::now().time_since_epoch()).count());
}
std::size_t random_index(std::size_t max)
@ -81,7 +81,7 @@ xlnt::workbook non_optimized_workbook(int n)
for(int idx = 1; idx < n; idx++)
{
auto worksheet = wb[random_index(wb.sheet_count())];
auto cell = worksheet.cell(1, (xlnt::row_t)idx);
auto cell = worksheet.cell(xlnt::cell_reference(1, (xlnt::row_t)idx));
cell.value(0);
cell.style(styles.at(random_index(styles.size())));
}

View File

@ -4,7 +4,7 @@
std::size_t current_time()
{
return std::chrono::duration<double, std::milli>(std::chrono::system_clock::now().time_since_epoch()).count();
return static_cast<std::size_t>(std::chrono::duration<double, std::milli>(std::chrono::system_clock::now().time_since_epoch()).count());
}
// Create a worksheet with variable width rows. Because data must be
@ -15,13 +15,6 @@ void writer(int cols, int rows)
xlnt::workbook wb;
auto ws = wb.create_sheet();
std::vector<int> row;
for(int i = 0; i < cols; i++)
{
row.push_back(i);
}
for(int index = 0; index < rows; index++)
{
if ((index + 1) % (rows / 10) == 0)
@ -31,7 +24,10 @@ void writer(int cols, int rows)
std::cout.flush();
}
ws.append(row);
for (int i = 0; i < cols; i++)
{
ws.cell(xlnt::cell_reference(i + 1, index + 1)).value(i);
}
}
std::cout << std::endl;