summaryrefslogtreecommitdiffstats
path: root/bench/tests/element-creation.js
blob: 6e35a08f4ffe5506296db51e89ed5c2b150d3297 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
;(function(bench) {
  
  bench.test('generate 10000 rects', function() {
    for (var i = 0; i < 10000; i++)
      bench.draw.rect(100,100)
  })

  bench.test('generate 10000 rects with fill', function() {
    for (var i = 0; i < 10000; i++)
      bench.draw.rect(100,100).fill('#f06')
  })

  bench.test('generate 10000 rects with position and fill', function() {
    for (var i = 0; i < 10000; i++)
      bench.draw.rect(100,100).move(50,50).fill('#f06')
  })

})(SVG.bench);