X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=gcell%2Fapps%2Fbenchmark_dma.cc;fp=gcell%2Fapps%2Fbenchmark_dma.cc;h=bc3b3f3289f4914e9f8f2966e2033e99cbb5c505;hb=8a9ddbb0675f9bfcc6e03b457fba6c79474a3693;hp=a84defe3709c305f9dff93d4a785dc80f18750aa;hpb=82d471b9b4a8b389b5da44b19c69c36420828382;p=debian%2Fgnuradio diff --git a/gcell/apps/benchmark_dma.cc b/gcell/apps/benchmark_dma.cc index a84defe3..bc3b3f32 100644 --- a/gcell/apps/benchmark_dma.cc +++ b/gcell/apps/benchmark_dma.cc @@ -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 #endif #include -#include +#include #include #include #include @@ -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));