-1

I am using WEKA jvm and trying to run generalized sequential pattern algorithm on my data. I want to get execution time in millisecond. How can I do it ?

clouddy
  • 891
  • 2
  • 8
  • 10

1 Answers1

0

Firstly. this has nothing to do with weka. Remove that tag.

Put this at the beginning of your code

        long startTime = Calendar.getInstance().getTimeInMillis();

and at the end of your program,

        long endTime = Calendar.getInstance().getTimeInMillis();
        long timeTook = endTime - startTime
        System.out.println("time took in milliseconds="+timeTook);
        System.out.println("time took in seconds="+timeTook/1000);

System class also has methods currentTimeMillis() and nanoTime()

But keep that in mind, if you're taking input from users. More user waits to enter the input, more the time taken will be displayed.

Anurag Awasthi
  • 238
  • 2
  • 13