Indeed I used it in my perl program: system("time", "program-name", "file-name");
but the out is different (and confused) with respect to that right output I have just typing
time program-name file-name
in the shell.
Comment on Re^2: timing a command execution with perl
time typically outputs its values to STDERR (unless your version supports the -o option).
To capture STDERR in a Perl program, something like Capture::Tiny or IPC::Run3 makes that easy. (Or you can use shell redirects.)