From 2651c5ac511e9b7b09eeae3a0b5ec9ff6878a4e8 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 3 Nov 2015 10:19:51 -0500 Subject: [PATCH] `benchmark` rethrows. --- prototype/doubt-difftool/main.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prototype/doubt-difftool/main.swift b/prototype/doubt-difftool/main.swift index ecbbb361d..70d6c0f59 100644 --- a/prototype/doubt-difftool/main.swift +++ b/prototype/doubt-difftool/main.swift @@ -3,9 +3,9 @@ import Doubt import Prelude import Madness -func benchmark(label: String? = nil, _ f: () -> T) -> T { +func benchmark(label: String? = nil, _ f: () throws -> T) rethrows -> T { let start = NSDate.timeIntervalSinceReferenceDate() - let result = f() + let result = try f() let end = NSDate.timeIntervalSinceReferenceDate() print((label.map { "\($0): " } ?? "") + "\(end - start)s") return result