📝 Doc params in window.coffee

This commit is contained in:
Kevin Sawicki 2014-02-12 08:54:16 -08:00
parent a1ce1c9ef6
commit 8b83918a24

View File

@ -1,9 +1,8 @@
# Public: Measure how long a function takes to run.
#
# * description:
# A {String} description that will be logged to the console.
# * fn:
# A {Function} to measure the duration of.
# description - A {String} description that will be logged to the console when
# the function completes.
# fn - A {Function} to measure the duration of.
#
# Returns the value returned by the given function.
window.measure = (description, fn) ->
@ -15,13 +14,11 @@ window.measure = (description, fn) ->
# Public: Create a dev tools profile for a function.
#
# * description:
# A {String} descrption that will be available in the Profiles tab of the dev
# tools.
# * fn:
# A {Function} to profile.
# description - A {String} description that will be available in the Profiles
# tab of the dev tools.
# fn - A {Function} to profile.
#
# Return the value returned by the given function.
# Returns the value returned by the given function.
window.profile = (description, fn) ->
measure description, ->
console.profile(description)