43 unsigned int lines_to_write = 1;
44 float f = 33.54235235;
47 std::cout << std::endl;
48 std::cout <<
"***********************************************************" << std::endl;
49 std::cout <<
" Printf" << std::endl;
50 std::cout <<
"***********************************************************" << std::endl;
51 std::cout << std::endl;
53 for (
unsigned int i = 0; i < lines_to_write; ++i ) {
54 printf(
"Heya Dude\n");
57 for (
unsigned int i = 0; i < lines_to_write; ++i ) {
58 printf(
"Heya Dude\n");
60 times[0] = stopwatch.split();
61 for (
unsigned int i = 0; i < lines_to_write; ++i ) {
65 for (
unsigned int i = 0; i < lines_to_write; ++i ) {
68 times[3] = stopwatch.split();
70 std::cout << std::endl;
71 std::cout <<
"***********************************************************" << std::endl;
72 std::cout <<
" Cout" << std::endl;
73 std::cout <<
"***********************************************************" << std::endl;
74 std::cout << std::endl;
76 for (
unsigned int i = 0; i < lines_to_write; ++i ) {
77 std::cout <<
"Heya Dude\n";
81 for (
unsigned int i = 0; i < lines_to_write; ++i ) {
82 std::cout <<
"Heya Dude\n";
85 times[1] = stopwatch.split();
87 std::cout.precision(4);
88 for (
unsigned int i = 0; i < lines_to_write; ++i ) {
89 std::cout <<
f <<
" \n";
93 for (
unsigned int i = 0; i < lines_to_write; ++i ) {
94 std::cout <<
f <<
" \n";
97 times[4] = stopwatch.split();
99 std::cout << std::endl;
100 std::cout <<
"***********************************************************" << std::endl;
101 std::cout <<
" Ostream" << std::endl;
102 std::cout <<
"***********************************************************" << std::endl;
103 std::cout << std::endl;
106 for (
unsigned int i = 0; i < lines_to_write; ++i ) {
107 ostream <<
"Heya Dude\n";
111 for (
unsigned int i = 0; i < lines_to_write; ++i ) {
112 ostream <<
"Heya Dude\n";
115 times[2] = stopwatch.split();
117 for (
unsigned int i = 0; i < lines_to_write; ++i ) {
118 ostream << format(
f) <<
" \n";
122 for (
unsigned int i = 0; i < lines_to_write; ++i ) {
123 ostream << format(
f) <<
" \n";
126 times[5] = stopwatch.split();
128 std::cout << std::endl;
129 std::cout <<
"***********************************************************" << std::endl;
130 std::cout <<
" Times" << std::endl;
131 std::cout <<
"***********************************************************" << std::endl;
132 std::cout << std::endl;
134 std::cout <<
"Writing Char Strings:" << std::endl;
135 std::cout <<
" printf : " << times[0].nsec() <<
" ns" << std::endl;
136 std::cout <<
" cout : " << times[1].nsec() <<
" ns" << std::endl;
137 std::cout <<
" OConsoleStream : " << times[2].nsec() <<
" ns" << std::endl;
138 std::cout <<
"Streaming Floats:" << std::endl;
139 std::cout <<
" printf : " << times[3].nsec() <<
" ns" << std::endl;
140 std::cout <<
" cout : " << times[4].nsec() <<
" ns" << std::endl;
141 std::cout <<
" OConsoleStream : " << times[5].nsec() <<
" ns" << std::endl;
143 std::cout << std::endl;
144 std::cout <<
"***********************************************************" << std::endl;
145 std::cout <<
" Passed" << std::endl;
146 std::cout <<
"***********************************************************" << std::endl;
147 std::cout << std::endl;