本文整理汇总了C++中Timer::End方法的典型用法代码示例。如果您正苦于以下问题:C++ Timer::End方法的具体用法?C++ Timer::End怎么用?C++ Timer::End使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timer
的用法示例。
在下文中一共展示了Timer::End方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
TEST(TestTimer, Construct) {
Timer timer;
timer.Start("a");
EXPECT_ANY_THROW(timer.End("b"));
timer.End("a");
timer.Display();
}
示例2: App_Run
void App_Run()
{
while (!g_quit)
{
App_ProcessEvents();
App_UpdateTimer();
App_UpdateFPS();
Timer updateTimer;
App_Update();
updateTimer.End();
Timer renderTimer;
App_Draw();
renderTimer.End();
if (!(g_frameIndex & 15))
{
g_updateTime = updateTimer.ToSeconds();
g_renderTime = renderTimer.ToSeconds();
}
if (g_enableOnScreenDebugInfo)
App_DrawDebugInfo();
App_EndDrawFrame();
g_frameIndex++;
}
Postprocessing::EnableBloom(false);
Postprocessing::EnableOldTV(false);
Postprocessing::EnableRainyGlass(false);
Postprocessing_ShutdownQuake();
}
示例3: n
TEST(Time, MatrixAccess) {
int n(1000);
MatrixXcd a(n, n);
dcomplex *b = new dcomplex[n*n];
Timer timer;
timer.Start("Eigen");
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
a(i, j) = 1.2;
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
a(i, j);
timer.End("Eigen");
timer.Start("Array");
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
b[i+n*j] = 1.2;
dcomplex cumsum(0);
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
cumsum += b[i+n*j];
timer.End("Array");
timer.Start("Array2");
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
b[j+n*i] = 1.2;
cumsum = 0;
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
cumsum += b[j+n*i];
timer.End("Array2");
timer.Display();
Timer timer1;
MatrixXcd xyz(3, 2);
timer1.Start("MatrixXyz");
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++) {
xyz(0, 0) = 1.0;
xyz(0, 1) = 1.2;
}
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++) {
dcomplex x= xyz(0, 0);
x = xyz(0, 1);
}
timer1.End("MatrixXyz");
dcomplex xs[2];
timer1.Start("ArrayXyz");
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++) {
xs[0]= 1.0*i*j;
xs[1] = 1.2*i*j;
}
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++) {
dcomplex x= xs[0];
x = xs[1];
}
timer1.End("ArrayXyz");
vector<dcomplex> cs(2);
timer1.Start("VectorXyz");
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++) {
cs[0]= 1.0*i*j;
cs[1] = 1.2*i*j;
}
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++) {
dcomplex x= cs[0];
x = cs[1];
}
timer1.End("VectorXyz");
timer1.Display();
}
示例4: gtos
TEST(SymGTOs, method_time) {
Timer timer;
pSymmetryGroup sym = SymmetryGroup::D2h();
SymGTOs gtos(new _SymGTOs);
gtos->SetSym(sym);
Vector3cd xyz0(0.0, 0.0, 0.0);
// ---- s orbital ----
SubSymGTOs sub_s;
sub_s.AddXyz(Vector3cd(0, 0, 0));
sub_s.AddNs( Vector3i( 0, 0, 0));
int num_z(10);
VectorXcd zs(num_z); zs << 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0;
sub_s.AddZeta(zs);
sub_s.AddRds(Reduction(sym->irrep_s, MatrixXcd::Ones(1, 1)));
gtos->AddSub(sub_s);
// ---- p orbital ----
SubSymGTOs sub_p;
sub_p.AddXyz(Vector3cd(0, 0, 0));
sub_p.AddNs( Vector3i( 1, 0, 0));
sub_p.AddNs( Vector3i( 0, 1, 0));
sub_p.AddNs( Vector3i( 0, 0, 1));
int num_z_p(8);
VectorXcd zs_p(num_z_p); zs_p << 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8;
sub_p.AddZeta(zs_p);
MatrixXcd c1(1, 3); c1 << 1.0, 0.0, 0.0; sub_p.AddRds(Reduction(sym->irrep_x, c1));
MatrixXcd c2(1, 3); c2 << 0.0, 1.0, 0.0; sub_p.AddRds(Reduction(sym->irrep_y, c2));
MatrixXcd c3(1, 3); c3 << 0.0, 0.0, 1.0; sub_p.AddRds(Reduction(sym->irrep_z, c3));
gtos->AddSub(sub_p);
// -- potential --
MatrixXcd xyzq(4, 1); xyzq << 0.0, 0.0, 0.0, 1.0;
gtos->SetAtoms(xyzq);
gtos->SetUp();
BMatSet mat = CalcMat_Complex(gtos, true);
ERIMethod m00;
ERIMethod m01; m01.symmetry = 1;
ERIMethod m10; m10.coef_R_memo = 1;
ERIMethod m11; m11.coef_R_memo = 1; m11.symmetry = 1;
B2EInt eri00, eri01, eri10, eri11;
timer.Start("method00"); eri00 = CalcERI_Complex(gtos, m00); timer.End("method00");
timer.Start("method01"); eri01 = CalcERI_Complex(gtos, m01); timer.End("method01");
timer.Start("method10"); eri10 = CalcERI_Complex(gtos, m10); timer.End("method10");
timer.Start("method11"); eri11 = CalcERI_Complex(gtos, m11); timer.End("method11");
EXPECT_C_EQ(eri00->At(0, 0, 0, 0, 2, 1, 5, 0),
eri01->At(0, 0, 0, 0, 2, 1, 5, 0));
EXPECT_C_EQ(eri00->At(0, 0, 0, 0, 2, 1, 5, 0),
eri11->At(0, 0, 0, 0, 2, 1, 5, 0));
EXPECT_C_EQ(eri00->At(0, 0, 0, 0, 2, 1, 5, 0),
eri10->At(0, 0, 0, 0, 2, 1, 5, 0));
timer.Display();
cout << "size(eri00): " << eri00->size() << endl;
cout << "size(eri10): " << eri10->size() << endl;
cout << "size(eri01): " << eri01->size() << endl;
cout << "size(eri11): " << eri11->size() << endl;
}