$ time ./Test
real 0m2.906s
user 0m2.887s
sys 0m0.017s
Oto kod programu:Znaczenie rzeczywistych, użytkownika i sys w wyjściu Linux polecenia czasu
#include <iostream>
#include <map>
void func_a() {
std::map<int, int> m;
for (unsigned int i = 0; i < 10000; i++) {
m.insert(std::pair<int, int>(i, i));
}
}
void func_b() {
std::map<int, int> m;
for (unsigned int i = 0; i < 1000000; i++) {
m.insert(std::pair<int, int>(i, i));
}
}
int main() {
func_a();
func_b();
return 0;
}
[Tutaj] [1] daje bardzo dobre wytłumaczenie. [1]: http://stackoverflow.com/questions/556405/what-do-real-user-and-sys-mean-in-the-output-of-time1 – kzhong