00001 #ifndef RESMES_H 00002 #define RESMES_H 00003 00004 #include <vector> 00005 #include <iostream> 00006 #include <map> 00007 #include <ctime> 00008 #include <sys/resource.h> 00009 00014 class resmes 00015 { 00016 public: 00023 friend std::ostream &operator<<(std::ostream &os, const resmes &res); 00024 00028 resmes(); 00029 00034 void set_desc(const std::string &d); 00035 00041 void start(); 00042 00048 void stop(); 00049 00050 private: 00051 00055 std::string desc; 00056 00060 timeval start_time; 00061 00065 size_t depth; 00066 00070 std::vector<double> periods; 00071 }; 00072 00073 extern std::map<std::string, resmes> resources; 00074 00075 #endif // RESMES_H