有谁知道如何解决以下问题:编程课程想要测量解决练习需要多少时间。我使用Ubuntu 19.04。假设我使用 Visual Studio Codium 编写代码,并且本周没有在任何其他项目中使用它。我如何衡量编辑器在给定的一周内运行了多长时间?
答案1
一种方法是使用acct
会计实用程序。
来自 debian 包的描述:
$ apt-cache show acct
Package: acct
Version: 6.6.4-2
Installed-Size: 341
Maintainer: Debian Security Tools <[email protected]>
Architecture: amd64
Depends: libc6 (>= 2.14), lsb-base
Description-en: GNU Accounting utilities for process and login accounting
GNU Accounting Utilities is a set of utilities which reports and summarizes
data about user connect times and process execution statistics.
.
"Login accounting" provides summaries of system resource usage based on connect
time, and "process accounting" provides summaries based on the commands
executed on the system.
.
The 'last' command is provided by the sysvinit package and not included here.
主页:http://www.gnu.org/software/acct/
该软件包包括一个名为 的报告工具sa
。您可能必须在awk
或中编写脚本perl
,以将输出后处理sa
为您想要的确切形式。