Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit b106c48

Browse files
committed
Add benchmark script
1 parent 4d87c10 commit b106c48

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

script/benchmark.coffee

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env coffee
2+
3+
handler = require '../lib/spell-check-handler'
4+
fs = require 'fs'
5+
6+
pathToCheck = process.argv[2]
7+
console.log("Spellchecking %s...", pathToCheck)
8+
9+
text = fs.readFileSync(pathToCheck, 'utf8')
10+
11+
t0 = Date.now()
12+
result = handler({id: 1, text})
13+
t1 = Date.now()
14+
15+
console.log("Found %d misspellings in %d milliseconds", result.misspellings.length, t1 - t0)

0 commit comments

Comments
 (0)