本文整理汇总了C++中TTimer类的典型用法代码示例。如果您正苦于以下问题:C++ TTimer类的具体用法?C++ TTimer怎么用?C++ TTimer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TTimer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: VetoThres2
void VetoThres2(Int_t Lo, Int_t Hi)
{
TCanvas* Window;
TTimer* Refresh;
TH1F* Energy;
Char_t Buff[256];
Char_t* Keyb;
Double_t Pos[438];
Window = new TCanvas();
Window->SetCrosshair();
Window->ToggleEventStatus();
Refresh = new TTimer("Flush()", 50, kFALSE);
for(Int_t ch=Lo; ch<Hi+1; ch++)
{
sprintf(Buff, "Veto_Energy%d", ch);
Energy = (TH1F*)gROOT->FindObject(Buff);
Energy->GetXaxis()->SetRange(0, 250);
Energy->Draw();
Window->Update();
sprintf(Buff, "Threshold for %d: ", ch);
Refresh->TurnOn();
Refresh->Reset();
Keyb = Getline(Buff);
Refresh->TurnOff();
Pos[ch] = atof(Keyb);
}
for(Int_t ch=Lo; ch<Hi+1; ch++)
printf("%5.1f\n", Pos[ch]);
}
开发者ID:A2-Collaboration,项目名称:acqu,代码行数:30,代码来源:LadderTimes.cpp
示例2: deactivate
void TTimer::enableTimer()
{
if( canBeUnlocked( 0 ) )
{
if( activate() )
{
if( mScript.size() > 0 )
{
mpTimer->start();
}
}
else
{
deactivate();
mpTimer->stop();
}
}
if( ! isOffsetTimer() )
{
typedef list<TTimer *>::const_iterator I;
for( I it = mpMyChildrenList->begin(); it != mpMyChildrenList->end(); it++)
{
TTimer * pChild = *it;
if( ! pChild->isOffsetTimer() ) pChild->enableTimer();
}
}
}
开发者ID:,项目名称:,代码行数:27,代码来源:
示例3: KBucketIndex
void RoutingTable::TouchKBucket(const KadID &node_id) {
int index = KBucketIndex(node_id);
if (index < 0)
return;
TTimer timer;
k_buckets_[index]->set_last_accessed(static_cast<unsigned int>(timer.current()));
}
开发者ID:wxjeacen,项目名称:kadpeer,代码行数:7,代码来源:kadroutingtable.cpp
示例4: reenableAllTriggers
void TimerUnit::reenableAllTriggers()
{
for(auto it = mTimerRootNodeList.begin(); it != mTimerRootNodeList.end(); it++)
{
TTimer * pChild = *it;
pChild->enableTimer( pChild->getID() );
}
}
开发者ID:EldFitheach,项目名称:Mudlet,代码行数:8,代码来源:TimerUnit.cpp
示例5: reenableAllTriggers
void TimerUnit::reenableAllTriggers()
{
typedef list<TTimer *>::const_iterator I;
for( I it = mTimerRootNodeList.begin(); it != mTimerRootNodeList.end(); it++)
{
TTimer * pChild = *it;
pChild->enableTimer( pChild->getID() );
}
}
开发者ID:olostan,项目名称:Mudlet-vadi2,代码行数:9,代码来源:TimerUnit.cpp
示例6: main
int main(int argc, char** argv) {
size_t iter = 1;
int q = 1009;
int n = 2000;
std::string file = "";
Argument as[] = {
{ 'q', "-q Q", "Set the field characteristic (-1 for random).", TYPE_INT , &q },
{ 'n', "-n N", "Set the dimension of the matrix.", TYPE_INT , &n },
{ 'i', "-i R", "Set number of repetitions.", TYPE_INT , &iter },
{ 'f', "-f FILE", "Set the input file (empty for random).", TYPE_STR , &file },
END_OF_ARGUMENTS
};
FFLAS::parseArguments(argc,argv,as);
typedef Givaro::Modular<double> Field;
typedef Field::Element Element;
Field F(q);
Element * A;
TTimer chrono;
double time=0.0;
Field::RandIter G(F);
for (size_t i=0;i<iter;++i){
if (!file.empty()){
A = read_field (F, file.c_str(), &n, &n);
} else {
A = FFLAS::fflas_new<Element>(n*n);
for (size_t j=0; j<(size_t) n*n; ++j)
G.random(*(A+j));
}
for (size_t k=0;k<(size_t)n;++k)
while (F.isZero( G.random(*(A+k*(n+1)))));
chrono.clear();
chrono.start();
clapack_dtrtri(CblasRowMajor,CblasUpper, CblasNonUnit,n,A,n);
chrono.stop();
time+=chrono.usertime();
FFLAS::fflas_delete( A);
}
// -----------
// Standard output for benchmark - Alexis Breust 2014/11/14
std::cout << "Time: " << time / double(iter)
<< " Gflops: " << (2.*double(n)/1000.*double(n)/1000.*double(n)/1000.0) / time * double(iter) / 3.;
FFLAS::writeCommandString(std::cout, as) << std::endl;
return 0;
}
开发者ID:acheniour,项目名称:fflas-ffpack,代码行数:56,代码来源:benchmark-dtrtri.C
示例7: GetRefreshList
void RoutingTable::GetRefreshList(const unsigned short int &start_kbucket,
const bool &force, std::vector<KadID> *ids) {
TTimer timer ;
unsigned int curr_time = static_cast<unsigned int> (timer.system_time());
for (size_t i = start_kbucket; i < k_buckets_.size(); ++i)
if (force || curr_time-k_buckets_[i]->last_accessed() > KRefreshTime) {
ids->push_back(KadID(k_buckets_[i]->range_min(),
k_buckets_[i]->range_max()));
}
}
开发者ID:wxjeacen,项目名称:kadpeer,代码行数:10,代码来源:kadroutingtable.cpp
示例8: compileAll
void TimerUnit::compileAll()
{
for(auto it = mTimerRootNodeList.begin(); it != mTimerRootNodeList.end(); it++)
{
TTimer * pChild = *it;
if( pChild->isActive() )
{
pChild->mNeedsToBeCompiled = true;
}
}
}
开发者ID:EldFitheach,项目名称:Mudlet,代码行数:11,代码来源:TimerUnit.cpp
示例9: compileAll
void TimerUnit::compileAll()
{
typedef list<TTimer *>::const_iterator I;
for( I it = mTimerRootNodeList.begin(); it != mTimerRootNodeList.end(); it++)
{
TTimer * pChild = *it;
if( pChild->isActive() )
{
pChild->mNeedsToBeCompiled = true;
}
}
}
开发者ID:olostan,项目名称:Mudlet-vadi2,代码行数:12,代码来源:TimerUnit.cpp
示例10: _assembleReport
void TimerUnit::_assembleReport( TTimer * pChild )
{
list<TTimer*> * childrenList = pChild->mpMyChildrenList;
for(auto it2 = childrenList->begin(); it2 != childrenList->end(); it2++)
{
TTimer * pT = *it2;
_assembleReport( pT );
if( pT->isActive() ) statsActiveTriggers++;
if( pT->isTempTimer() ) statsTempTriggers++;
statsTriggerTotal++;
}
}
开发者ID:EldFitheach,项目名称:Mudlet,代码行数:12,代码来源:TimerUnit.cpp
示例11: wait
/************ wait funtion !! ***************************************************************
*********************************************************************************************/
void wait(){
TTimer *timer = new TTimer("gSystem->ProcessEvents();", 50, kFALSE);
char *input;
Bool_t done = kFALSE;
do{
timer->TurnOn();
timer->Reset();
input=Getline("Type <return> to continue : ");
timer->TurnOff();
if(input){ done =kTRUE; }
}while(!done);
}
开发者ID:samchen03,项目名称:rootMacro,代码行数:15,代码来源:read_scope_spect.c
示例12: removeAllTempTimers
void TimerUnit::removeAllTempTimers()
{
mCleanupList.clear();
for(auto it = mTimerRootNodeList.begin(); it != mTimerRootNodeList.end(); it++)
{
TTimer * pChild = *it;
if( pChild->isTempTimer() )
{
pChild->killTimer();
pChild->mOK_code = false; //important to not crash on stale Lua function args
markCleanup( pChild );
}
}
}
开发者ID:EldFitheach,项目名称:Mudlet,代码行数:14,代码来源:TimerUnit.cpp
示例13: getTimerPrivate
void TimerUnit::reParentTimer( int childID, int oldParentID, int newParentID, int parentPosition, int childPosition )
{
TTimer * pOldParent = getTimerPrivate( oldParentID );
TTimer * pNewParent = getTimerPrivate( newParentID );
TTimer * pChild = getTimerPrivate( childID );
if( ! pChild )
{
return;
}
pChild->disableTimer( childID );
if( pOldParent )
{
pOldParent->popChild( pChild );
}
if( ! pOldParent )
{
mTimerRootNodeList.remove( pChild );
}
if( pNewParent )
{
pNewParent->addChild( pChild, parentPosition, childPosition );
if( pChild ) pChild->setParent( pNewParent );
}
else
{
pChild->Tree<TTimer>::setParent( 0 );
addTimerRootNode( pChild, parentPosition, childPosition );
}
pChild->enableTimer( childID );
}
开发者ID:EldFitheach,项目名称:Mudlet,代码行数:33,代码来源:TimerUnit.cpp
示例14: compileAll
void TTimer::compileAll()
{
mNeedsToBeCompiled = true;
if( ! compileScript() )
{
if( mudlet::debugMode ) {TDebug(QColor(Qt::white),QColor(Qt::red))<<"ERROR: Lua compile error. compiling script of timer:"<<mName<<"\n">>0;}
mOK_code = false;
}
typedef list<TTimer *>::const_iterator I;
for( I it = mpMyChildrenList->begin(); it != mpMyChildrenList->end(); it++)
{
TTimer * pChild = *it;
pChild->compileAll();
}
}
开发者ID:,项目名称:,代码行数:15,代码来源:
示例15: killTimer
bool TimerUnit::killTimer(const QString & name )
{
for(auto it = mTimerRootNodeList.begin(); it != mTimerRootNodeList.end(); it++)
{
TTimer * pChild = *it;
if( pChild->getName() == name )
{
// only temporary timers can be killed
if( ! pChild->isTempTimer() ) return false;
pChild->killTimer();
markCleanup( pChild );
return true;
}
}
return false;
}
开发者ID:EldFitheach,项目名称:Mudlet,代码行数:16,代码来源:TimerUnit.cpp
示例16: trial1
void trial1()
{
gStyle->SetCanvasPreferGL(true);
//gStyle->SetFrameFillColor(42);
TCanvas *c1=new TCanvas("can1");
//can1->SetFillColor(17);
f1=new TF1("f1","[0]*x",0,10);
f1->SetParameter(0,1);
//f1->SetNpx(10);
f1->SetMaximum(10);
f1->SetMinimum(0);
f1->Draw();
TTimer *timer = new TTimer(20);
timer->SetCommand("Animate()");
timer->TurnOn();
}
开发者ID:kazumaishio,项目名称:cherenkov,代码行数:16,代码来源:trial1.C
示例17: removeAllTempTimers
void TimerUnit::removeAllTempTimers()
{
//qDebug()<<"vorher: TIMERS: insgesamt:"<<mTimerRootNodeList.size()<<" cleanup:"<<mCleanupList.size();
mCleanupList.clear();
typedef list<TTimer *>::const_iterator I;
for( I it = mTimerRootNodeList.begin(); it != mTimerRootNodeList.end(); it++)
{
TTimer * pChild = *it;
if( pChild->isTempTimer() )
{
pChild->killTimer();
pChild->mOK_code = false; //important to not crash on stale Lua function args
markCleanup( pChild );
}
}
//qDebug()<<"TIMERS: insgesamt:"<<mTimerRootNodeList.size()<<" cleanup:"<<mCleanupList.size();
}
开发者ID:olostan,项目名称:Mudlet-vadi2,代码行数:17,代码来源:TimerUnit.cpp
示例18: anim
void anim()
{
gStyle->SetFrameFillColor(42);
TCanvas *c1 = new TCanvas("c1");
c1->SetFillColor(17);
pi = TMath::Pi();
f2 = new TF2("f2","sin(2*x)*sin(2*y)*[0]",0,pi,0,pi);
f2->SetParameter(0,1);
f2->SetNpx(15);
f2->SetNpy(15);
f2->SetMaximum(1);
f2->SetMinimum(-1);
f2->Draw("surf1");
TTimer *timer = new TTimer(20);
timer->SetCommand("Animate()");
timer->TurnOn();
}
开发者ID:alcap-org,项目名称:AlcapDAQ,代码行数:17,代码来源:anim.C
示例19: Recover
/**
@SYMTestCaseID SYSLIB-DBMS-CT-1315
@SYMTestCaseDesc Database recovery test
@SYMTestPriority Medium
@SYMTestActions Calls up RDbStoreDatabase::Recover() function
@SYMTestExpectedResults Test must not fail
@SYMREQ REQ0000
*/
LOCAL_C void Recover()
{
test.Next(_L(" @SYMTestCaseID:SYSLIB-DBMS-CT-1315 "));
#ifndef __TOOLS2__
TheTimer.Start(_L("recover"));
#endif
test(TheDatabase.Recover()==KErrNone);
#ifndef __TOOLS2__
TheTimer.Stop();
#endif
test(!TheDatabase.IsDamaged());
}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:20,代码来源:t_big.cpp
示例20: TestIndex
/**
@SYMTestCaseID SYSLIB-DBMS-CT-0580
@SYMTestCaseDesc Tests the database definition and enquiry functions
@SYMTestPriority Medium
@SYMTestActions Tests by setting an active index for the table.
@SYMTestExpectedResults Test must not fail
@SYMREQ REQ0000
*/
LOCAL_C void TestIndex(const TDesC& aName,const CDbKey& aKey)
{
test.Next(_L(" @SYMTestCaseID:SYSLIB-DBMS-CT-0580 "));
#ifndef __TOOLS2__
TheTimer.Start(_L("build"));
#endif
test(TheDatabase.CreateIndex(aName,KTableName,aKey)==KErrNone);
#ifndef __TOOLS2__
TheTimer.Stop();
#endif
test(TheTable.Open(TheDatabase,KTableName)==KErrNone);
test(TheTable.SetIndex(aName)==KErrNone);
IterateL(TheTable.ENext);
TheTable.Close();
}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:23,代码来源:t_big.cpp
注:本文中的TTimer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论