This commit is contained in:
Spencer Gibb
2015-07-04 00:49:44 -06:00
parent 74c077816d
commit cf41d8ece6

View File

@@ -30,19 +30,22 @@ public class MilliSpan implements Span {
@Override
public synchronized void stop() {
if (end == 0) {
if (begin == 0)
if (begin == 0) {
throw new IllegalStateException("Span for " + name
+ " has not been started");
}
end = System.currentTimeMillis();
}
}
@Override
public synchronized long getAccumulatedMillis() {
if (begin == 0)
if (begin == 0) {
return 0;
if (end > 0)
}
if (end > 0) {
return end - begin;
}
return System.currentTimeMillis() - begin;
}