-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.h
56 lines (51 loc) · 1.24 KB
/
test.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef TEST_H
#define TEST_H
#include "cstralgo.h"
#include <string>
#include <iostream>
#include <string>
#include <boost/lexical_cast.hpp>
#include <time.h>
class Test
{
public:
Test();
~Test();
void testtransform( )
{
std::string word ="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
word =word+word+word+word+word+word+word+word+word+word+word+word+word+word+word;
std::string word2=word;
time_t t;
time_t t2;
time(&t);
std::cout << "testtransform: start " << "\n";
int i=0;
for(;i<9999999;i++)
{ word2=word;
std::transform(word2.begin(), word2.end(), word2.begin(), ::tolower);
}
time(&t2);
std::cout << word2 << "\n";
std::cout << "testtransform: end " << i << ":"<< t2-t << "\n";
}
void testmytolower( )
{
std::string word ="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
word =word+word+word+word+word+word+word+word+word+word+word+word+word+word+word;
std::string word2=word;
time_t t;
time_t t2;
time(&t);
std::cout << "testmytolower: start " << "\n";
int i=0;
for(;i<9999999;i++)
{ word2=word;
cstralgo::tolowerStr(word2);
}
time(&t2);
std::cout << word2 << "\n";
std::cout << "testmytolower: end " << i << ":"<< t2-t << "\n";
}
};
#endif // TEST_H