Time logging info

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@3601 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
hieuhoang1972 2010-10-01 18:08:10 +00:00
parent be8dbd20e9
commit 60db2a2971
2 changed files with 12 additions and 3 deletions

View File

@ -43,8 +43,10 @@ namespace MosesChart
Manager::Manager(InputType const& source, const TranslationSystem* system)
:m_source(source)
,m_hypoStackColl(source, *this)
,m_transOptColl(source, system, m_hypoStackColl),
m_system(system)
,m_transOptColl(source, system, m_hypoStackColl)
,m_system(system)
,m_start(clock())
{
m_system->InitializeBeforeSentenceProcessing(source);
}
@ -52,6 +54,12 @@ Manager::Manager(InputType const& source, const TranslationSystem* system)
Manager::~Manager()
{
m_system->CleanUpAfterSentenceProcessing();
clock_t end = clock();
float et = (end - m_start);
et /= (float)CLOCKS_PER_SEC;
VERBOSE(1, "Translation took " << et << " seconds" << endl);
}
void Manager::ProcessSentence()

View File

@ -45,7 +45,8 @@ protected:
TranslationOptionCollection m_transOptColl; /**< pre-computed list of translation options for the phrases in this sentence */
std::auto_ptr<Moses::SentenceStats> m_sentenceStats;
const Moses::TranslationSystem* m_system;
clock_t m_start; /**< starting time, used for logging */
public:
Manager(Moses::InputType const& source, const Moses::TranslationSystem* system);
~Manager();