提交 00c0ab12 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 90793554
......@@ -135,20 +135,9 @@ public class MathUtils {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(bout);
// milliseconds
// milliseconds and nanoseconds
out.writeLong(System.currentTimeMillis());
// nanoseconds if available
try {
Method m = System.class.getMethod("nanoTime");
if (m != null) {
Object o = m.invoke(null);
out.writeUTF(o.toString());
}
} catch (Exception e) {
// nanoTime not found, this is ok (only exists for JDK 1.5 and higher)
out.writeUTF(e.toString());
}
out.writeLong(System.nanoTime());
// memory
out.writeInt(new Object().hashCode());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论