Fixed iconv perf test to print out results
git-svn-id: http://svn.code.sf.net/p/utfcpp/code@123 a809a056-fc17-0410-9590-b4f493f8b08e
This commit is contained in:
parent
9d7a97089c
commit
36839ac4e7
1 changed files with 6 additions and 0 deletions
|
@ -46,6 +46,7 @@ int main(int argc, char** argv)
|
|||
cout << "utf8::utf8to16: ";
|
||||
timer t(cout);
|
||||
utf8::utf8to16(buf, buf + length, utf16buf);
|
||||
t.print_time();
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -54,6 +55,7 @@ int main(int argc, char** argv)
|
|||
cout << "unchecked::utf8to16: ";
|
||||
timer t(cout);
|
||||
utf8::unchecked::utf8to16(buf, buf + length, utf16buf);
|
||||
t.print_time();
|
||||
}
|
||||
|
||||
// the UTF-16 result will not be larger than this (I hope :) )
|
||||
|
@ -75,6 +77,7 @@ int main(int argc, char** argv)
|
|||
{
|
||||
timer t(cout);
|
||||
iconv(cd, &inbuf, &in_bytes_left, &outbuf, &out_bytes_left);
|
||||
t.print_time();
|
||||
}
|
||||
iconv_close(cd);
|
||||
}
|
||||
|
@ -102,6 +105,7 @@ int main(int argc, char** argv)
|
|||
{
|
||||
timer t(cout);
|
||||
iconv(cd, &inbuf, &in_bytes_left, &outbuf, &out_bytes_left);
|
||||
t.print_time();
|
||||
}
|
||||
iconv_close(cd);
|
||||
}
|
||||
|
@ -112,6 +116,7 @@ int main(int argc, char** argv)
|
|||
cout << "unchecked::utf16to8: ";
|
||||
timer t(cout);
|
||||
utf8::unchecked::utf16to8(utf16buf, utf16buf + wlength, buf);
|
||||
t.print_time();
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -119,6 +124,7 @@ int main(int argc, char** argv)
|
|||
cout << "utf16to8: ";
|
||||
timer t(cout);
|
||||
utf8::utf16to8(utf16buf, utf16buf + wlength, buf);
|
||||
t.print_time();
|
||||
}
|
||||
|
||||
delete [] buf;
|
||||
|
|
Loading…
Reference in a new issue