Merge branch 'upstream' into dfsg-orig
[debian/gnuradio] / gcell / apps / benchmark_dma.cc
index a84defe3709c305f9dff93d4a785dc80f18750aa..bc3b3f3289f4914e9f8f2966e2033e99cbb5c505 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2007,2008 Free Software Foundation, Inc.
+ * Copyright 2007,2008,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -23,7 +23,7 @@
 #include <config.h>
 #endif
 #include <gcell/gc_job_manager.h>
-#include <gnuradio/omni_time.h>
+#include <boost/date_time/posix_time/posix_time_types.hpp>
 #include <getopt.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -95,6 +95,8 @@ init_jd(gc_job_desc *jd, unsigned int usecs,
 static void
 run_test(unsigned int nspes, unsigned int usecs, unsigned int dma_size, int getput_mask)
 {
+  using namespace boost::posix_time;
+
   static const int64_t TOTAL_SIZE_DMA = 5LL << 30;
   static const int NJDS = 64;
   unsigned int njobs = (unsigned int)(TOTAL_SIZE_DMA / dma_size);
@@ -148,7 +150,7 @@ run_test(unsigned int nspes, unsigned int usecs, unsigned int dma_size, int getp
 
   for (int iter = 0; iter < 1; iter++){
 
-    omni_time t_start = omni_time::time();
+    ptime t_start(microsec_clock::universal_time());
 
     nsubmitted = 0;
     ncompleted = 0;
@@ -203,9 +205,9 @@ run_test(unsigned int nspes, unsigned int usecs, unsigned int dma_size, int getp
     }
 
     // stop timing
-    omni_time t_stop = omni_time::time();
+    ptime t_stop(microsec_clock::universal_time());
 
-    double delta = (t_stop - t_start).double_time();
+    double delta = (t_stop - t_start).total_microseconds() * 1e-6;
     printf("nspes: %2d  udelay: %4d  elapsed_time: %7.3f  dma_size: %5d  dma_throughput: %7.3e\n",
           mgr->nspes(), usecs, delta, dma_size,
           (double) njobs * dma_size / delta * (getput_mask == BENCHMARK_GET_PUT ? 2.0 : 1.0));