[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] (no subject)
From: |
Greg Chicares |
Subject: |
[lmi-commits] (no subject) |
Date: |
Thu, 23 Jun 2016 16:18:40 +0000 (UTC) |
branch: master
commit 6e8a70d00ff81ecefad34729fa2eb31d67f44e0c
Author: Gregory W. Chicares <address@hidden>
Date: Sun Jun 19 21:03:17 2016 +0000
Currency unit test: also measure speed of raw amount_type
---
currency_test.cpp | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/currency_test.cpp b/currency_test.cpp
index ffaadde..55160c5 100644
--- a/currency_test.cpp
+++ b/currency_test.cpp
@@ -198,6 +198,15 @@ void time_double()
}
}
+void time_amount_type()
+{
+ currency::amount_type a(123);
+ for(int j = 0; j < 1000000; ++j)
+ {
+ do_some_arithmetic(a);
+ }
+}
+
void time_currency()
{
currency c(1, 23);
@@ -211,8 +220,9 @@ void currency_test::test_speed()
{
std::cout
<< " Speed tests..."
- << "\n double : " << TimeAnAliquot(time_double)
- << "\n currency: " << TimeAnAliquot(time_currency)
+ << "\n double : " << TimeAnAliquot(time_double)
+ << "\n amount_type: " << TimeAnAliquot(time_amount_type)
+ << "\n currency : " << TimeAnAliquot(time_currency)
<< std::endl
;
}