We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent efff286 commit 4aacee7Copy full SHA for 4aacee7
snippets/ruby/ruby.json
@@ -29,6 +29,26 @@
29
"end"
30
]
31
},
32
+ "Ruby Benchmark Measure": {
33
+ "prefix": "benchm",
34
+ "body": [
35
+ "require 'benchmark'",
36
+ "",
37
+ "puts Benchmark.measure { ${1:# benchmark code} }"
38
+ ]
39
+ },
40
+ "Ruby Benchmark BM": {
41
+ "prefix": "benchbm",
42
43
44
45
+ "n = ${1:50000}",
46
+ "Benchmark.bm do |x|",
47
+ " x.report(\"${2:Task 1}\") { n.times { ${3:\"task 1\"} } }",
48
+ " x.report(\"${4:Task 2}\") { n.times { ${5:\"task 2\"} } }",
49
+ "end"
50
51
52
"Class definition with initialize": {
53
"prefix": "class init",
54
"body": [
0 commit comments