mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
change benchmark call away from removed cell method, fix benchmark warnings
This commit is contained in:
parent
f6626e5079
commit
c448536e38
@ -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())));
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user