|
|
I've got a couple of Unix questions...
#1: Consider the following:
~$ /usr/bin/time --format="%C\n%E wall time, %P CPU, %M KB maximum"
./Prog1
./Prog1
0:15.27 wall time, 89% CPU, 1608592 KB maximum
The program *actually* used about 400MB of RAM. So WTF is %M actually
measuring? Because it sure as hell isn't "maximum resident set size of
the process during its lifetime, measured in Kilobytes".
(Also, why do %D, %K and %X all return 0 for every program?)
More generally, how do I make time tell me HOW MUCH RAM WAS USED?
#2: You can compile a C++ program with
g++ program.c++
However, for reasons beyond my comprehension, the result is always named
"a.out". You can tediously fix this using the -o option. Alternatively,
you can write a makefile:
prog1: prog1.c++
g++ prog1.c++ -o prog1
prog2: prog2.c++
g++ prog2.c++ -o prog2
prog3: prog3.c++
g++ prog3.c++ -o prog3
Is there any way of automating this absurd tedium?
Post a reply to this message
|
|