mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 07:28:08 +03:00
add fpbenchmark and fbenchmark
This commit is contained in:
parent
ffeab94472
commit
51c02f236c
@ -15,14 +15,18 @@ keymap.bindKeys '*',
|
||||
$(document).on 'close', -> window.close()
|
||||
$(document).on 'show-console', -> window.showConsole()
|
||||
|
||||
window.profile = (description, fn) ->
|
||||
window.showConsole()
|
||||
window.benchmark(description, fn, true)
|
||||
|
||||
window.pbenchmark = window.profile
|
||||
window.fpbenchmark = (description, fn) -> window.profile(description, fn, true)
|
||||
window.fbenchmark = (description, fn, profile) -> window.benchmark(description, fn, profile, true)
|
||||
|
||||
window.benchmark = (description, fn, profile=false) ->
|
||||
it description, ->
|
||||
window.profile = (description, fn, focused) ->
|
||||
window.showConsole()
|
||||
window.benchmark(description, fn, true, focused)
|
||||
|
||||
window.benchmark = (description, fn, profile=false, focused=false) ->
|
||||
method = if focused then fit else it
|
||||
method description, ->
|
||||
count = 100
|
||||
total = measure ->
|
||||
console.profile(description) if profile
|
||||
|
@ -17,11 +17,11 @@ describe "Editor", ->
|
||||
editor.insertText('x')
|
||||
editor.backspace()
|
||||
|
||||
fdescribe "when editing a ~300 line CoffeeScript file", ->
|
||||
describe "when editing a ~300 line CoffeeScript file", ->
|
||||
beforeEach ->
|
||||
editor.setBuffer new Buffer(require.resolve('fixtures/medium.coffee'))
|
||||
|
||||
benchmark "inserting and deleting a character", ->
|
||||
fbenchmark "inserting and deleting a character", ->
|
||||
editor.insertText('x')
|
||||
editor.backspace()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user