Skip to content

Instantly share code, notes, and snippets.

@mootari
Last active August 29, 2015 14:05
Show Gist options
  • Save mootari/d032735f5719e43cc396 to your computer and use it in GitHub Desktop.
Save mootari/d032735f5719e43cc396 to your computer and use it in GitHub Desktop.
profile: Sass extension to profile execution times during compilation. #sass #ruby #extension
module Sass::Script::Functions
@@timeStart = Time.now
@@timeLast = Time.now
def profileRender(timeLast)
diff = Time.now - timeLast
return Sass::Script::String.new(diff * 1000.0)
end
def profileTotal()
return self.profileRender(@@timeStart)
end
def profileLast()
str = profileRender(@@timeLast)
@@timeLast = Time.now
return str
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment