-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boost: switch deprecated boost/timer.hpp to boost/timer/timer.hpp
- Change header from boost/timer.hpp to boost/timer/timer.hpp - Change boost::timer to boost::timer::auto_cpu_timer - Handle switch to nanoseconds - Build Boost timer library if needed
- Loading branch information
Showing
9 changed files
with
54 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
#include <cctbx/math/cos_sin_table.h> | ||
#include <iostream> | ||
#include <boost/timer.hpp> | ||
#include <boost/timer/timer.hpp> | ||
|
||
int main() { | ||
unsigned const n = 1024, p = 1024; | ||
cctbx::math::cos_sin_table<double> table(n); | ||
cctbx::math::cos_sin_exact<double> exact; | ||
std::complex<double> sum = 0; | ||
boost::timer t; | ||
boost::timer::auto_cpu_timer t; | ||
for (unsigned i=0; i<p*n; ++i) { | ||
sum += table(i); | ||
} | ||
std::cout << t.elapsed() << "\t" << sum << std::endl; | ||
std::cout << boost::timer::format(t.elapsed()) << "\t" << sum << std::endl; | ||
sum = 0; | ||
t.restart(); | ||
t.start(); | ||
for (unsigned i=0; i<p*n; ++i) { | ||
sum += exact(i); | ||
} | ||
std::cout << t.elapsed() << "\t" << sum << std::endl; | ||
std::cout << boost::timer::format(t.elapsed()) << "\t" << sum << std::endl; | ||
std::cout << "OK\n" << std::endl; | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters