search

Home  >  Q&A  >  body text

java - Eclipse怎么统计程序运行了多久?

想知道这个代码道理会运行多久,之前用过matlab它可以很方便的一键统计,Eclipse可以吗?还是只能getsystemtime自己处理了?

PHP中文网PHP中文网2889 days ago515

reply all(3)I'll reply

  • 迷茫

    迷茫2017-04-17 18:01:20

    Use log, you can calculate the specific running time through log code, of course System.currentTimeMillis().

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 18:01:20

    Shouldn’t counting code running time be done at the code level? I don’t know if Eclipse has this function, but I’ve never seen it.

    reply
    0
  • 阿神

    阿神2017-04-17 18:01:20

    用JUnit的测试用例啊,通过添加注解,可以测试程序的执行时间,非常方便的。

    reply
    0
  • Cancelreply