(b *testing.B)
| 58 | } |
| 59 | |
| 60 | func (gorp *Gorp) Update(b *testing.B) { |
| 61 | m := NewModel() |
| 62 | |
| 63 | err := gorp.conn.Insert(m) |
| 64 | if err != nil { |
| 65 | helper.SetError(b, gorp.Name(), "Update", err.Error()) |
| 66 | } |
| 67 | |
| 68 | b.ReportAllocs() |
| 69 | b.ResetTimer() |
| 70 | |
| 71 | for i := 0; i < b.N; i++ { |
| 72 | _, err := gorp.conn.Update(m) |
| 73 | if err != nil { |
| 74 | helper.SetError(b, gorp.Name(), "Update", err.Error()) |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | func (gorp *Gorp) Read(b *testing.B) { |
| 80 | m := NewModel() |