D
D
dpushin12020-08-09 21:15:03
Java
dpushin1, 2020-08-09 21:15:03

How to track time in the app?

Such a question, how to track through java, time in any application / game?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2020-08-09
@Survtur

import java.util.Date;

public class Test {

   public static void main(String args[]) {
      // Инициализация объекта date
      Date date = new Date();

      // Вывод текущей даты и времени с использованием toString()
      System.out.println(date.toString());
   }
}

O
Odissey Nemo, 2020-12-10
@odissey_nemo

Maybe the execution time, ie. time since program start?
If yes, then org.apache.commons.lang.time.StopWatch is convenient.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question