Home  >  Q&A  >  body text

linux - ubuntu如何查看C语言程序执行时间和程序的内存使用情况?

阿神阿神2714 days ago440

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 16:51:20

    Suppose you run the program ./test. After running (or while running), enter ps aux | grep test, and the meaning of the returned information is ps aux | grep test,返回的信息含义为


    这其中就有CPU使用、内存使用情况,以及运行时间。
    特别的,如果需要在程序运行中实时查看这些信息,输入top | grep test,就会每一秒显示一次,Ctrl + C


    Among them are CPU usage, memory usage, and running time.
    Specially, if you need to view this information in real time while the program is running, enter top | grep test, it will be displayed once every second, and Ctrl + C will exit. 🎜

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 16:51:20

    time test, add time in front to display the time

    reply
    0
  • Cancelreply