Does anyone know how to solve the following: A programming course wants to measure how much time it takes to solve the exercises. I use Ubuntu 19.04. Let's say I write the code by using Visual Studio Codium and do not use it any other projects on the week. How can I measure how long the editor is running on given week?
One method is to use the
acct accounting utilities.
From the debian package description:
$ apt-cache show acct Package: acct Version: 6.6.4-2 Installed-Size: 341 Maintainer: Debian Security Tools <email@example.com> 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.
This package includes a reporting tool called
sa. You may have to write scripts in
perl or something to post-process
sa's output into the exact form you want.