In C++, with this:
std::time_t first = time(NULL); /* .. code .. */ std::time_t second = time(NULL); std::cout << "Seg : " << difftime(second,first) << std::endl; I can determine my program's execution duration.
Can I determine its memory consumption at different points through the program?
newoperators and count the memory used. Voila, you got your mechanism ;) ... you can also use profilers with or without instrumentation to achieve the same.