From 052638a76f3c07be744b603c3ba0f392ccc1569b Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sun, 18 Apr 2010 20:13:47 -0700 Subject: Convert gcell to use boost::threads instead of omnithread. Passes make check. --- gcell/apps/benchmark_nop.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'gcell/apps/benchmark_nop.cc') diff --git a/gcell/apps/benchmark_nop.cc b/gcell/apps/benchmark_nop.cc index dee46c842..a27373db4 100644 --- a/gcell/apps/benchmark_nop.cc +++ b/gcell/apps/benchmark_nop.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 @@ -47,6 +47,8 @@ init_jd(gc_job_desc *jd, unsigned int usecs) static void run_test(unsigned int nspes, unsigned int usecs, int njobs) { + using namespace boost::posix_time; + static const int NJDS = 64; int nsubmitted = 0; int ncompleted = 0; @@ -73,7 +75,7 @@ run_test(unsigned int nspes, unsigned int usecs, int njobs) init_jd(all_jds[i], usecs); } - omni_time t_start = omni_time::time(); + ptime t_start(microsec_clock::universal_time()); ci = 0; njds[0] = 0; @@ -122,8 +124,8 @@ run_test(unsigned int nspes, unsigned int usecs, int njobs) } // stop timing - omni_time t_stop = omni_time::time(); - double delta = (t_stop - t_start).double_time(); + ptime t_stop(microsec_clock::universal_time()); + double delta = (t_stop - t_start).total_microseconds() * 1e-6; printf("nspes: %2d udelay: %4d elapsed_time: %7.3f njobs: %g speedup: %6.3f\n", mgr->nspes(), usecs, delta, (double) njobs, njobs * usecs * 1e-6 / delta); -- cgit