TimeUtils
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
+2
-5
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user