mail[Wesnoth-commits] r24897 - /trunk/src/server/server.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by cycholka on March 20, 2008 - 12:48:
Author: cycholka
Date: Thu Mar 20 12:48:19 2008
New Revision: 24897

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24897&view=rev
Log:
Commit a tentative patch of server.cpp to allow compilation under Windows 
again. Introduces boost::timer header dependency. Needs review by Sirp.

Modified:
    trunk/src/server/server.cpp

Modified: trunk/src/server/server.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/server.cpp?rev=24897&r1=24896&r2=24897&view=diff
==============================================================================
--- trunk/src/server/server.cpp (original)
+++ trunk/src/server/server.cpp Thu Mar 20 12:48:19 2008
@@ -44,7 +44,8 @@
 #include <sstream>
 #include <vector>
 
-#include <sys/times.h>
+//#include <sys/times.h>
+#include <boost/timer.hpp>
 
 #include <csignal>
 
@@ -483,10 +484,13 @@
 
                                const bool sample = request_sample_frequency 
= 1 && (sample_counter++ % request_sample_frequency) == 0;
 
-                               struct tms before_parsing, after_parsing, 
after_processing;
+                               boost::timer parsing_timer;
+                               double after_parsing, after_processing;
+//                             struct tms before_parsing, after_parsing, 
after_processing;
 
                                if(sample) {
-                                       times(&before_parsing);
+                                   parsing_timer.restart();
+//                                     times(&before_parsing);
                                }
 
                                char* buf_ptr = new char [buf.size()];
@@ -496,16 +500,20 @@
                                std::vector<char>().swap(buf);
 
                                if(sample) {
-                                       times(&after_parsing);
+                                       after_parsing = 
parsing_timer.elapsed();   
+//                                     times(&after_parsing);
                                }
 
                                process_data(sock, data);
 
                                if(sample) {
-                                       times(&after_processing);
+                                       double after_processing = 
parsing_timer.elapsed();         
+//                                     times(&after_processing);
                                        
metrics_.record_sample(data.root().first_child(),
-                                                 after_parsing.tms_utime - 
before_parsing.tms_utime,
-                                                 after_processing.tms_utime 
- after_parsing.tms_utime);
+//                                               after_parsing.tms_utime - 
before_parsing.tms_utime,
+                                                         after_parsing,
+//                                               after_processing.tms_utime 
- after_parsing.tms_utime);
+                                                         after_processing - 
after_parsing);
                                }
                        }
 




Related Messages


Powered by MHonArc, Updated Thu Mar 20 13:02:13 2008