Javaの記録方法ストップウォッチタイミングツール

import org.springframework.util.StopWatch;
public static void main(String[] args) throws InterruptedException {
        StopWatch sw = new StopWatch("测试计时工具类StopWatch");
        sw.start("第一次计时");
        Thread.sleep(100);
        sw.stop();
        sw.start("第二次计时");
        Thread.sleep(200);
        sw.stop();
        System.out.println(sw.prettyPrint());
    }

次のように出力される:
ストップウォッチ「テストタイミングツールストップウォッチ」:実行時間(ミリ秒) = 302

ミズ タスク名
00101 033パーセント 最初のタイマー
00201 067パーセント 第2のタイミング
公開された10元の記事 ウォンの賞賛3 ビュー174

おすすめ

転載: blog.csdn.net/qq_40016813/article/details/103123141