Last active
August 29, 2015 14:05
-
-
Save mootari/d032735f5719e43cc396 to your computer and use it in GitHub Desktop.
profile: Sass extension to profile execution times during compilation. #sass #ruby #extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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