-1

I am currently using time command from the terminal to check how much time my java program took, using the following command.

time java  -Djava.util.concurrent.ForkJoinPool.common.parallelism=40 TestingNumberOfThreads

// Result
real    0m4.356s
user    0m46.273s
sys 0m0.702s

Is there a way I can achieve the same from IntelliJ?

Neeraj Jain
  • 7,397
  • 6
  • 31
  • 55
  • 1
    I mean, why cant you use , System.currentTimeMillis() at the beginning and at the end of the program . Simply subtract these values to get execution time – NiksVij Jun 28 '19 at 19:28
  • 1
    Honestly, you do not **time** java applications. If you perceive a performance problem, you **benchmark** them. https://stackoverflow.com/questions/504103/how-do-i-write-a-correct-micro-benchmark-in-java ... – GhostCat Jun 28 '19 at 19:30
  • @NiksVij I can definitely do that and I use `System.nanoTime()` instead of `System.currentTimeMillis()` to get more accurate results whenever required, I just want to know if there is a way to specify time command in IntelliJ. Nothing less nothing more. – Neeraj Jain Jun 28 '19 at 20:00
  • @GhostCat I just want to know if there is a way to add the "time" command from IntelliJ configurations. I don't want to debug any performance problem as of now. – Neeraj Jain Jun 28 '19 at 20:01

1 Answers1

0

You’d need a profiler. I believe the plugin VisualVM Profiler for IntelliJ might be what you’re looking for. Here’s the link to it: https://plugins.jetbrains.com/plugin/3749-visualvm-profiler/

vtboyarc
  • 23
  • 1
  • 6