Changeset 2212 in Sophya for trunk/SophyaLib/SysTools/resusage.cc
- Timestamp:
- Oct 15, 2002, 5:48:53 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/SysTools/resusage.cc
r2191 r2212 16 16 The information should be updated through the call to the 17 17 Update() method. 18 Note: The information is obtained through \c getrusage() 19 and \c getrlimit() system calls, and depending on the OS, 20 not all of the memory usage values are correctly filled. 21 \code 22 // How to check resource usage for a given part of the program 23 ResourceUsage res; 24 // --- Part of the program to be checked : Start 25 // ... 26 res.Update(); 27 cout << " Memory size increase (KB):" << res.getDeltaMemorySize() << endl; 28 cout << " Resource usage info : \n" << res << endl; 29 \endcode 18 30 */ 19 31 /*! 32 Constructor. the \b Update() method is called. 33 */ 20 34 ResourceUsage::ResourceUsage() 21 35 { … … 47 61 48 62 } 49 63 /*! 64 Destructor. 65 */ 50 66 ResourceUsage::~ResourceUsage() 51 67 { … … 58 74 } 59 75 76 /*! 77 Update the CPU and memory usage information. 78 */ 60 79 int ResourceUsage::Update() 61 80 { … … 82 101 } 83 102 103 /*! 104 Prints the CPU and memory usage information. 105 \param os : The output stream 106 \param lp : The print level (0 .. 2) 107 \param upd : if \c true , the Update method is called. 108 */ 84 109 void ResourceUsage::Print(ostream& os, int lp, bool upd) 85 110 {
Note:
See TracChangeset
for help on using the changeset viewer.