You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package excelize
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func BenchmarkWrite(b *testing.B) {
|
|
|
|
const s = "This is test data"
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
f := NewFile()
|
|
|
|
for row := 1; row <= 10000; row++ {
|
|
|
|
for col := 1; col <= 20; col++ {
|
|
|
|
val, err := CoordinatesToCellName(col, row)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
if err := f.SetCellDefault("Sheet1", val, s); err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Save xlsx file by the given path.
|
|
|
|
err := f.SaveAs("./test.xlsx")
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|