mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
calc time consumed in load_test
This commit is contained in:
parent
192bcf879a
commit
2b72d1cf91
@ -1,4 +1,5 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <ctime>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include "../src/Limonp/ArgvContext.hpp"
|
#include "../src/Limonp/ArgvContext.hpp"
|
||||||
#include "../src/Limonp/io_functs.hpp"
|
#include "../src/Limonp/io_functs.hpp"
|
||||||
@ -30,14 +31,15 @@ void cut(const ISegment * seg, const char * const filePath, size_t times = 10)
|
|||||||
|
|
||||||
int main(int argc, char ** argv)
|
int main(int argc, char ** argv)
|
||||||
{
|
{
|
||||||
{
|
|
||||||
MixSegment seg("../dict/jieba.dict.utf8", "../dict/hmm_model.utf8");
|
MixSegment seg("../dict/jieba.dict.utf8", "../dict/hmm_model.utf8");
|
||||||
if(!seg)
|
if(!seg)
|
||||||
{
|
{
|
||||||
cout<<"seg init failed."<<endl;
|
cout<<"seg init failed."<<endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
long beginTime = clock();
|
||||||
cut(&seg, "../test/testdata/weicheng.utf8");
|
cut(&seg, "../test/testdata/weicheng.utf8");
|
||||||
}
|
long endTime = clock();
|
||||||
|
printf("[%.3lf seconds]time consumeed.\n", double(endTime - beginTime)/CLOCKS_PER_SEC);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user