lib/judges/elapsed.rb in judges-0.7.0 vs lib/judges/elapsed.rb in judges-0.8.0
- old
+ new
@@ -18,15 +18,17 @@
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
+require 'tago'
+
def elapsed(loog)
start = Time.now
begin
yield
rescue UncaughtThrowError => e
tag = e.tag
throw e unless tag.is_a?(Symbol)
- loog.info("#{tag} in #{format('%.02f', Time.now - start)}s")
+ loog.info("#{tag} in #{start.ago}")
end
end