feat: 초기 프로젝트 설정 및 룰.md 파일 추가
This commit is contained in:
34
api.hyungi.net/node_modules/fclone/bench/loopobj.js
generated
vendored
Normal file
34
api.hyungi.net/node_modules/fclone/bench/loopobj.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
'use strict'
|
||||
const Benchmark = require('benchmark')
|
||||
const suite = new Benchmark.Suite
|
||||
|
||||
let obj = process.env
|
||||
|
||||
suite
|
||||
.add('for in', function() {
|
||||
for(let i in obj) {
|
||||
let o = obj[i]
|
||||
}
|
||||
})
|
||||
.add('while --', function() {
|
||||
let keys = Object.keys(obj)
|
||||
let l = keys.length
|
||||
while(l--) {
|
||||
let o = obj[keys[l]]
|
||||
}
|
||||
})
|
||||
.add('while shift', function() {
|
||||
let keys = Object.keys(obj)
|
||||
let k
|
||||
|
||||
while(k = keys.shift()) {
|
||||
let o = obj[k]
|
||||
}
|
||||
})
|
||||
.on('cycle', function(event) {
|
||||
console.log(String(event.target))
|
||||
})
|
||||
.on('complete', function() {
|
||||
console.log('Fastest is ' + this.filter('fastest').map('name'))
|
||||
})
|
||||
.run({ 'async': true })
|
||||
Reference in New Issue
Block a user