當前位置: 首頁>>代碼示例>>Java>>正文


Java ResultFormat類代碼示例

本文整理匯總了Java中org.openjdk.jmh.results.format.ResultFormat的典型用法代碼示例。如果您正苦於以下問題:Java ResultFormat類的具體用法?Java ResultFormat怎麽用?Java ResultFormat使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ResultFormat類屬於org.openjdk.jmh.results.format包,在下文中一共展示了ResultFormat類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: main

import org.openjdk.jmh.results.format.ResultFormat; //導入依賴的package包/類
public static void main(String[] args) throws RunnerException, IOException {
	final String include;
	if (args.length == 0) {
		include = askRunAll();
	} else {
		include = args[0];
	}
	final Options opt = new OptionsBuilder()//
		.include(include)//
		.mode(Mode.Throughput)//
		.measurementIterations(3)//
		.measurementBatchSize(1)//
		.measurementTime(TimeValue.milliseconds(1000))//
		.forks(1)//
		.timeUnit(TimeUnit.MICROSECONDS)//
		.warmupIterations(3)//
		.warmupTime(TimeValue.milliseconds(1000))//
		.build();
	final Collection<RunResult> runResult = new Runner(opt).run();
	System.out.flush();
	final ResultFormat resultFormat = ResultFormatFactory.getInstance(ResultFormatType.CSV, System.out);
	resultFormat.writeOut(runResult);
	System.out.flush();
}
 
開發者ID:tools4j,項目名稱:decimal4j,代碼行數:25,代碼來源:JmhRunner.java

示例2: getResultFormater

import org.openjdk.jmh.results.format.ResultFormat; //導入依賴的package包/類
private static ResultFormat getResultFormater(final File outputFile) {
  return new ResultFormat() {
    @Override
    public void writeOut(Collection<RunResult> results) {
      try {
        PrintStream pw = new PrintStream(outputFile, "UTF-8");
        ResultFormat rf = new H2OResultFormat(pw, ",", H2O_UBENCH_GIT_SHA, H2O_UBENCH_DATE);
        rf.writeOut(results);
        pw.flush();
        pw.close();
      } catch (IOException e) {
        throw new IllegalStateException(e);
      }
    }
  };
}
 
開發者ID:h2oai,項目名稱:h2o-3,代碼行數:17,代碼來源:H2oJmhRunner.java

示例3: printResult

import org.openjdk.jmh.results.format.ResultFormat; //導入依賴的package包/類
private static void printResult(Collection<RunResult> runResults) {
    System.out.println();

    ResultFormat resultFormat = ResultFormatFactory.getInstance(ResultFormatType.TEXT, System.out);
    resultFormat.writeOut(runResults);
}
 
開發者ID:gvsmirnov,項目名稱:java-perv,代碼行數:7,代碼來源:ComparingBenchmark.java


注:本文中的org.openjdk.jmh.results.format.ResultFormat類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。