提交 f50a31c7 编写于 作者: S Stepan Koltsov

TimeUtils

上级 9cc11adf
/*
* Copyright 2010-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.jet;
/**
* @author Stepan Koltsov
*/
public class TimeUtils {
public static String millisecondsToSecondsString(long millis) {
return millis / 1000 + "." + String.format("%03d", millis % 1000);
}
}
......@@ -21,6 +21,7 @@ import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.io.FileUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.JetTestUtils;
import org.jetbrains.jet.TimeUtils;
import java.io.File;
import java.io.FileOutputStream;
......@@ -70,16 +71,12 @@ abstract class ForTestCompileSomething {
FileUtil.delete(classesDir);
long end = System.currentTimeMillis();
System.out.println("Compiling " + jarName + " done in " + millisecondsToSecondsString(end - start) + "s");
System.out.println("Compiling " + jarName + " done in " + TimeUtils.millisecondsToSecondsString(end - start) + "s");
} catch (Throwable e) {
error = e;
}
}
private static String millisecondsToSecondsString(long millis) {
return millis / 1000 + "." + String.format("%03d", millis % 1000);
}
private static void copyToJar(File root, JarOutputStream os) throws IOException {
Stack<Pair<String, File>> toCopy = new Stack<Pair<String, File>>();
toCopy.add(new Pair<String, File>("", root));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册