Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ボタンが押された後の時間を計算して、これだけ経過したことを追跡できるようにしたい.
前もって感謝します。
スタートボタンを押すと:
long start = System.currentTimeMillis();
更新/終了ボタンを押すと:
long runTime = System.currentTimeMillis() - start;
2 つのイベント間の時間差のみを計算する場合は、 を使用できます System.currentTimeMillis();。
System.currentTimeMillis();