• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ end_time函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中end_time函数的典型用法代码示例。如果您正苦于以下问题:C++ end_time函数的具体用法?C++ end_time怎么用?C++ end_time使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了end_time函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: _receive_msg

        /*
         * the main method
         * receives a Flow message and prints out its associated information
         * If the message belongs to another class, an exception is thrown.
         */
        virtual void _receive_msg(std::shared_ptr<const Msg>&& m, int /* index */)
        {
            if ( m->type() == MSG_ID(Flow) )
            {
                auto flow = static_cast<const Flow *>(m.get());
                std::stringstream ss;
                const FlowKey& fk = flow->key();
                int duration = flow->end_time() - flow->start_time();
                ss<<"packets="<<flow->packets() << ",";
                ss<<"bytes="<<flow->bytes() << ",";
                ss<<"start="<<flow->start_time() << ",";
                ss<<"end="<<flow->end_time() << ",";
                ss<<"duration.us="<<duration<< ",";
                ss<<"source.ip4="<<ip_to_string(fk.src_ip4)<< ",";
                ss<<"source.port="<<fk.src_port<< ",";
                ss<<"destination.ip4="<<ip_to_string(fk.dst_ip4)<< ",";
                ss<<"destination.port="<<fk.dst_port;
                /*
                ss<<"Flow of  "<< flow->packets() << " packets and "<<flow->bytes()<<" bytes begin at "<<flow->start_time()<<" end at "<<flow->end_time()<< "duration (ms.) "<<duration <<std::endl;
                ss<<"SRC IP "<<ip_to_string(fk.src_ip4)<<" SRC port "<<fk.src_port<<std::endl;
                ss<<"DST IP "<<ip_to_string(fk.dst_ip4)<<" DST port "<<fk.dst_port<<std::endl;
                //ss<<"protocol "<<fk.proto<<std::endl;
                */
                blocklog(ss.str(),log_info);


            }
                else
            {
                throw std::runtime_error("Flowprinter: wrong message type");
            }
        }
开发者ID:cnplab,项目名称:blockmon,代码行数:37,代码来源:FlowPrinter.cpp


示例2: main

int main() {
	int i;
	double libc, fire;
	struct firedns_state state, *s = &state;
	firedns_init(s);
	firedns_add_servers_from_resolv_conf(s);

	printf("Testing %d firedns_resolveip4list(\"%s\"):\n",TESTS,TEST_HOST);
	start_time();
	for (i = 0; i < TESTS; i++)
		firedns_resolveip4list(s, TEST_HOST);
	fire = end_time();

	printf("Testing %d gethostbyname(\"%s\"):\n",TESTS,TEST_HOST);
	start_time();
	for (i = 0; i < TESTS; i++)
		gethostbyname(TEST_HOST);
	libc = end_time();

	if (libc > fire)
		printf("Speedup: %d%%\n",(int) (((libc - fire) / libc) * 100.0));
	else
		printf("Slowdown: %d%%\n",(int) (((fire - libc) / libc) * 100.0));

	return 0;
}
开发者ID:drb,项目名称:firedns,代码行数:26,代码来源:benchmark.c


示例3: prolongate

void prolongate( int level ) {
	int i,j;
	const int prolongation_vars[1] = { VAR_POTENTIAL };
	int icell;
	int num_level_cells;
	int *level_cells;

	cart_assert( level >= min_level+1 );

	start_time( WORK_TIMER );

	select_level( level-1, CELL_TYPE_LOCAL | CELL_TYPE_REFINED, &num_level_cells, &level_cells );
#pragma omp parallel for default(none), private(i,icell,j), shared(num_level_cells,level_cells,cell_vars,cell_child_oct)
	for ( i = 0; i < num_level_cells; i++ ) {
		icell = level_cells[i];

		for ( j = 0; j < num_children; j++ ) {
			cell_potential( cell_child(icell,j) ) = cell_interpolate( icell, j, VAR_POTENTIAL );
		}
	}
	cart_free( level_cells );

	end_time( WORK_TIMER );

	/* update buffers */
	start_time( PROLONGATE_UPDATE_TIMER );
	update_buffer_level( level, prolongation_vars, 1 );
	end_time( PROLONGATE_UPDATE_TIMER );
}
开发者ID:sleitner,项目名称:cart,代码行数:29,代码来源:gravity.c


示例4: compute_accelerations_particles

void compute_accelerations_particles( int level ) {
	int i, j;
	double a2half;
	const int accel_vars[nDim] = { VAR_ACCEL, VAR_ACCEL+1, VAR_ACCEL+2 };
	int neighbors[num_neighbors];
	int L1, R1;
	double phi_l, phi_r;
	int icell;
	int num_level_cells;
	int *level_cells;

	start_time( GRAVITY_TIMER );
	start_time( PARTICLE_ACCEL_TIMER );
	start_time( WORK_TIMER );

#ifdef COSMOLOGY
	a2half = -0.5*abox[level]*abox[level]*cell_size_inverse[level];
#else
	a2half = -0.5 * cell_size_inverse[level];
#endif

	select_level( level, CELL_TYPE_LOCAL, &num_level_cells, &level_cells );
#pragma omp parallel for default(none), private(icell,j,neighbors,L1,R1,phi_l,phi_r), shared(num_level_cells,level_cells,level,cell_vars,a2half)
	for ( i = 0; i < num_level_cells; i++ ) {
		icell = level_cells[i];

		cell_all_neighbors( icell, neighbors );
		for ( j = 0; j < nDim; j++ ) {
			L1 = neighbors[2*j];
			R1 = neighbors[2*j+1];

			if ( cell_level(L1) < level ) {
				phi_l = 0.8*cell_potential(L1) + 0.2*cell_potential(icell);
			} else {
				phi_l = cell_potential(L1);
			}

			if ( cell_level(R1) < level ) {
				phi_r = 0.8*cell_potential(R1)+0.2*cell_potential(icell);
			} else {
				phi_r = cell_potential(R1);
			}

			cell_accel( icell, j ) = (float)(a2half * ( phi_r - phi_l ) );
		}
	}
	cart_free( level_cells );

	end_time( WORK_TIMER );

	/* update accelerations */
	start_time( PARTICLE_ACCEL_UPDATE_TIMER );
	update_buffer_level( level, accel_vars, nDim );
	end_time( PARTICLE_ACCEL_UPDATE_TIMER );

	end_time( PARTICLE_ACCEL_TIMER );
	end_time( GRAVITY_TIMER );
}
开发者ID:sleitner,项目名称:cart,代码行数:58,代码来源:gravity_step.c


示例5: free_matrix_indices

void DiscreteProblem::create_matrix()
{
  // remove any previous matrix
  free_matrix_indices();
  free_matrix_values();

  // calculate the total number of DOFs
  ndofs = 0;
  for (int i = 0; i < neq; i++)
    ndofs += spaces[i]->get_num_dofs();
  if (!quiet) verbose("Ndofs: %d", ndofs);
  if (!ndofs) return;

  // get row and column indices of nonzero matrix elements
  Page** pages = new Page*[ndofs];
  memset(pages, 0, sizeof(Page*) * ndofs);
  if (!quiet) { verbose("Calculating matrix sparse structure..."); begin_time(); }
  precalculate_sparse_structure(pages);

  // initialize the arrays Ap and Ai
  Ap = (int*) malloc(sizeof(int) * (ndofs+1));
  int aisize = get_num_indices(pages, ndofs);
  Ai = (int*) malloc(sizeof(int) * aisize);
  if (Ai == NULL) error("Out of memory. Could not allocate the array Ai.");

  // sort the indices and remove duplicities, insert into Ai
  int i, pos = 0, num;
  for (i = 0; i < ndofs; i++)
  {
    Ap[i] = pos;
    pos += sort_and_store_indices(pages[i], Ai + pos, Ai + aisize);
  }
  Ap[i] = pos;
  if (!quiet) verbose("  Nonzeros: %d\n  Total matrix size: %0.1lf MB\n  (time: %g sec)",
                         pos, (double) get_matrix_size() / (1024*1024), end_time());
  delete [] pages;

  // shrink Ai to the actual size
  int* oldAi = Ai;
  Ai = (int*) realloc(Ai, sizeof(int) * pos);
  if (oldAi != Ai) warn("Realloc moved Ai when shrinking."); // this should not happen

  // UMFPACK: perform symbolic analysis of the matrix
  if (!quiet) { verbose("Performing UMFPACK symbolic analysis..."); begin_time(); }
  int status = umfpack_symbolic(ndofs, ndofs, Ap, Ai, NULL, &Symbolic, NULL, NULL);
  if (status != UMFPACK_OK) umfpack_status(status);
  if (!quiet) verbose("  (time: %g sec)", end_time());

  equi = (double*) malloc(sizeof(double) * ndofs);
  if (equi == NULL) error("Out of memory. Error allocating the equilibration vector.");
  for (int i = 0; i < ndofs; i++)
    equi[i] = 1.0;
  is_equi = false;
}
开发者ID:regmi,项目名称:hermes2d,代码行数:54,代码来源:discrete.cpp


示例6: rtOtvetSingleSourceEddingtonTensor

void rtOtvetSingleSourceEddingtonTensor(int level)
{
  int i, j, l, index, cell;
  int num_level_cells, *level_cells;
  double eps1, eps2, dr2, pos[nDim];

  start_time(WORK_TIMER);

  eps1 = 0.01*cell_size[rtSingleSourceLevel]*cell_size[rtSingleSourceLevel];
  eps2 = 9*cell_size[rtSingleSourceLevel]*cell_size[rtSingleSourceLevel];

  select_level(level,CELL_TYPE_LOCAL,&num_level_cells,&level_cells);

#pragma omp parallel for default(none), private(index,cell,pos,dr2,i,j,l), shared(level,num_level_cells,level_cells,rtSingleSourceValue,rtSingleSourcePos,eps1,eps2,cell_vars)
  for(index=0; index<num_level_cells; index++)
    {
      cell = level_cells[index];
      cell_center_position(cell,pos);

      dr2 = eps1;
      for(i=0; i<nDim; i++)
	{
	  pos[i] -= rtSingleSourcePos[i];
	  if(pos[i] >  0.5*num_grid) pos[i] -= num_grid;
	  if(pos[i] < -0.5*num_grid) pos[i] += num_grid;
	  dr2 += pos[i]*pos[i];
	}

      cell_var(cell,RT_VAR_OT_FIELD) = rtSingleSourceValue/(4*M_PI*dr2);
      
      dr2 += nDim*eps2;
      for(l=j=0; j<nDim; j++)
	{
	  for(i=0; i<j; i++)
	    {
	      cell_var(cell,rt_et_offset+l++) = pos[i]*pos[j]/dr2;
	    }
	  cell_var(cell,rt_et_offset+l++) = (eps2+pos[j]*pos[j])/dr2;
	}
    }

  cart_free(level_cells);

  end_time(WORK_TIMER);

  start_time(RT_SINGLE_SOURCE_UPDATE_TIMER);
  update_buffer_level(level,rtOtvetETVars,rtNumOtvetETVars);
  end_time(RT_SINGLE_SOURCE_UPDATE_TIMER);
}
开发者ID:sleitner,项目名称:cart,代码行数:49,代码来源:rt_otvet.c


示例7: readFile

int readFile(int use, int dsize)
{
    int p;

    if (largeFile) start_time();

    handle = open(testFile, O_RDONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
    if (handle == -1)
    {
        sprintf(resultchars, " Cannot open %s for reading\n", testFile);
        return 0;
    }

    for (p=0; p<use; p++)
    {
        if (read(handle, dataIn, dsize) == -1)
        {
            sprintf(resultchars," Error reading file %s block %d\n", testFile, p+1);
            return 0;
        }

    }
    close(handle);
    if (largeFile) end_time();
    return 1;
}
开发者ID:DEEDS-TUD,项目名称:PAIN,代码行数:26,代码来源:drivespeed.c


示例8: _on_event

Note<Time>::Note(const Note<Time>& copy)
	: _on_event(copy._on_event, true)
	, _off_event(copy._off_event, true)
{
	set_id (copy.id());

	assert(_on_event.buffer());
	assert(_off_event.buffer());
	/*
	  assert(copy._on_event.size == 3);
	  _on_event.buffer = _on_event_buffer;
	  memcpy(_on_event_buffer, copy._on_event_buffer, 3);

	  assert(copy._off_event.size == 3);
	  _off_event.buffer = _off_event_buffer;
	  memcpy(_off_event_buffer, copy._off_event_buffer, 3);
	*/

	assert(time() == copy.time());
	assert(end_time() == copy.end_time());
	assert(length() == copy.length());
	assert(note() == copy.note());
	assert(velocity() == copy.velocity());
	assert(_on_event.channel() == _off_event.channel());
	assert(channel() == copy.channel());
}
开发者ID:63n,项目名称:ardour,代码行数:26,代码来源:Note.cpp


示例9: writeFile

int writeFile(int use, int dsize)
{
    int  p;

    if (largeFile) start_time();

    if (useCache)
    {
        handle = open(testFile, O_WRONLY | O_CREAT | O_TRUNC,
                      S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
    }
    else
    {
        handle = open(testFile, O_WRONLY | O_CREAT | O_TRUNC | O_DIRECT | O_SYNC,
                      S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP| S_IROTH | S_IWOTH); // O_DIRECT | O_SYNC
    }
    if (handle == -1)
    {
        sprintf(resultchars, " Cannot open %s for writing\n", testFile);
        return 0;
    }

    for (p=0; p<use; p++)
    {
        if (write(handle, dataOut, dsize) != dsize )
        {
            sprintf(resultchars," Error writing file %s block %d\n", testFile, p+1);
            return 0;
        }
    }
    close(handle);

    if (largeFile) end_time();
    return 1;
}
开发者ID:DEEDS-TUD,项目名称:PAIN,代码行数:35,代码来源:drivespeed.c


示例10: main

int main(int argc, char* argv[])
{
  // Load the mesh
  Mesh mesh;
  H2DReader mloader;
  mloader.load("domain.mesh", &mesh);
  for (int i=0; i < INIT_REF_NUM; i++) mesh.refine_all_elements();

  // Initialize the shapeset and the cache
  H1Shapeset shapeset;
  PrecalcShapeset pss(&shapeset);

  // Create finite element space
  H1Space space(&mesh, &shapeset);
  space.set_bc_types(bc_types);
  space.set_bc_values(bc_values);
  space.set_uniform_order(P_INIT);

  // Enumerate basis functions
  space.assign_dofs();

  // Initialize the weak formulation
  WeakForm wf(1);
  wf.add_biform(0, 0, bilinear_form, bilinear_form_ord, SYM);
  wf.add_liform(0, linear_form, linear_form_ord);
  wf.add_liform_surf(0, linear_form_surf, linear_form_surf_ord, 2);

  // Visualize solution and mesh
  ScalarView sview("Coarse solution", 0, 100, 798, 700);
  OrderView  oview("Polynomial orders", 800, 100, 798, 700);

  // Matrix solver
  UmfpackSolver solver;

  // Time measurement
  double cpu = 0;
  begin_time();

  // Solve the problem
  Solution sln;
  LinSystem ls(&wf, &solver);
  ls.set_spaces(1, &space);
  ls.set_pss(1, &pss);
  ls.assemble();
  ls.solve(1, &sln);

  // Time measurement
  cpu += end_time();

  // View the solution and mesh
  sview.show(&sln);
  oview.show(&space);

  // Print timing information
  verbose("Total running time: %g sec", cpu);

  // wait for all views to be closed
  View::wait("Waiting for all views to be closed.");
  return 0;
}
开发者ID:martinlanzendorfer,项目名称:hermes2d,代码行数:60,代码来源:main.cpp


示例11: ROS_DEBUG

void HeaderManipulation::publishMsg(const topic_tools::ShapeShifter &msg, const ros::Time &msg_in_time)
{
    ROS_DEBUG("HeaderManipulation publishMsg Thread started with timestamp %f", msg_in_time.toSec());
    ros::Time end_time(ros::Time::now());
    ros::Time last_time;
    config_mutex_.lock();
    ros::Time time_to_pub(msg_in_time + msg_delay_);
    config_mutex_.unlock();
    do
    {
        last_time = end_time;
        ROS_DEBUG("waiting to publish msg from %f at %f", msg_in_time.toSec(), time_to_pub.toSec());
        if (end_time > time_to_pub)
        {
            boost::mutex::scoped_lock pub_lock(pub_mutex_);
            ROS_DEBUG("publishing msg which should be held back till: %f", time_to_pub.toSec());
            generic_pub_.publish(msg);
            return;
        }
        boost::mutex::scoped_lock config_lock(config_mutex_);
        publish_retry_rate_.sleep();
        time_to_pub = msg_in_time + msg_delay_;
        end_time = ros::Time::now();
    } while (last_time <= end_time);
    ROS_WARN("Detected jump back in time. Dropping msg. last: %f, end %f",
             last_time.toSec(), end_time.toSec());
    return;
}
开发者ID:fkunz,项目名称:ros_tools,代码行数:28,代码来源:HeaderManipulation.cpp


示例12: rtInitRun

void rtInitRun()
{
#ifdef RT_TEST
  frt_real Yp = 1.0e-10;
#else
  frt_real Yp = constants->Yp;
#endif
  frt_real Tmin = gas_temperature_floor;
  frt_real D2GminH2 = rt_dust_to_gas_floor*(constants->Dsun/constants->Zsun);
  frt_real CluFacH2 = rt_clumping_factor;
  frt_real CohLenH2 = rt_coherence_length;
  frt_real fGal = rt_uv_emissivity_stars;
  frt_real fQSO = rt_uv_emissivity_quasars;
  frt_intg IPOP = rt_stellar_pop;
  frt_intg IREC = 0;
  frt_intg IOUNIT = 81;

  start_time(WORK_TIMER);

  frtCall(initrun2)(&Yp,&Tmin,&D2GminH2,&CluFacH2,&CohLenH2,&fGal,&fQSO,&IPOP,&IREC,&IOUNIT);

  end_time(WORK_TIMER);

#ifdef RT_TRANSFER
  rtInitRunTransfer();
#endif
}
开发者ID:sleitner,项目名称:cart,代码行数:27,代码来源:rt.c


示例13: init_ga

void init_ga(int num_circles)
{
	char *end_time_str;
	struct timespec tp1, tp2;
	int idx;
	if(_is_initialized)
		return;

	printfl(IA_INFO,
	    "initializing for genetic algorithm, this may take some time....");
	_is_initialized = true;
	circle_pool = calloc(GEN_SIZE, sizeof(struct ia_circles *));
	start_time(&tp1);

	for(idx = 0; idx < GEN_SIZE; idx++) {
		circle_pool[idx] = calloc(1, sizeof(struct ia_circles));
		init_circles(circle_pool[idx], num_circles);
	}

	for(idx = 0; idx < GEN_SIZE; idx++) {
		//for(jdx = 0; jdx < 2; jdx++) {
		//	_seed_mutate(&circle_pool[idx]);
		//}
		refresh_circles(circle_pool[idx]);
		sort_circles(circle_pool[idx]);
	}

	end_time_str = end_time(&tp1, &tp2, "time");
	printfi("%s\nsee, that didn't take too long, did it?\n", end_time_str);
	free(end_time_str);
}
开发者ID:Nazgolze,项目名称:image-approximator,代码行数:31,代码来源:ga.c


示例14: rtInitStep

void rtInitStep(double dt)
{
  frt_real uDen = units->number_density;
  frt_real uLen = units->length;
  frt_real uTime = units->time;
  frt_real dtCode = dt;

#ifdef COSMOLOGY
  frt_real aExp = abox[min_level];
  frt_real daExp = abox_from_tcode(tl[min_level]+dt) - abox[min_level];
  frt_real HExp = Hubble(aExp)/units->time;
#else
  frt_real aExp = 1.0;
  frt_real daExp = 0.0;
  frt_real HExp = 0.0;
#endif

  start_time(WORK_TIMER);

  frtCall(stepbegin)(&uDen,&uLen,&uTime,&aExp,&HExp,&daExp,&dtCode);

  end_time(WORK_TIMER);

#ifdef RT_TRANSFER
  rtInitStepTransfer();
#endif

  rtUpdateTables();

#ifdef RT_DEBUG
  switch(rt_debug.Mode)
    {
    case 1:
      {
	int i, cell;
	cell = cell_find_position(rt_debug.Pos);
	cart_debug("In cell-level debug for cell %d/%d",cell,cell_level(cell));
	cart_debug("RT_HVAR_OFFSET: %d",RT_HVAR_OFFSET);
#ifdef RT_VAR_SOURCE
	cart_debug("RT_VAR_SOURCE: %d",RT_VAR_SOURCE);
#endif
	cart_debug("rt_grav_vars_offset: %d",rt_grav_vars_offset);
#ifdef RT_TRANSFER
	cart_debug("rt_num_vars: %d",rt_num_vars);
#if (RT_TRANSFER_METHOD == RT_METHOD_OTVET)
	cart_debug("RT_VAR_OT_FIELD: %d",RT_VAR_OT_FIELD);
	cart_debug("rt_et_offset: %d",rt_et_offset);
	cart_debug("rt_field_offset: %d",rt_field_offset);
#endif
#endif
	for(i=0; i<num_vars; i++)
	  {
	    cart_debug("Var[%d] = %g",i,cell_var(cell,i));
	  }
	break;
      }
    }
#endif /* RT_DEBUG */
}
开发者ID:sleitner,项目名称:cart,代码行数:59,代码来源:rt.c


示例15: min

void Control::initTime()
{
    QSqlQuery query;
    QDateTime start_date_time;
    query.exec("select min(DATE),min(TIME) from DATAS");
    if(query.next()){
        int min_date = query.value(0).toInt();
        int min_time = query.value(1).toInt();
        int year = min_date / 10000;
        int month = min_date % 10000 / 100;
        int day = min_date % 100;
        int h = min_time / 10000;
        QTime start_time(h,0);
        QDate start_date(2000 +year,month,day);
        start_date_time = QDateTime(start_date,start_time);
    }

    query.exec("select max(DATE),max(TIME) from DATAS");
    QDateTime end_date_time;
    if(query.next()){
        int max_date = query.value(0).toInt();
        int max_time = query.value(1).toInt();
        int year = max_date / 10000;
        int month = max_date % 10000 / 100;
        int day = max_date % 100;
        int h = max_time / 10000;
        QTime end_time(h,0);
        QDate end_date(2000 +year,month,day);
        end_date_time = QDateTime(end_date,end_time);
    }
    ui->startDateTimeEdit->setDisplayFormat("yyyy-M-d HH");
    ui->endDateTimeEdit->setDisplayFormat("yyyy-M-d HH");
    ui->startDateTimeEdit->setMinimumDateTime(start_date_time);
    ui->startDateTimeEdit->setMaximumDateTime(end_date_time);
    ui->endDateTimeEdit->setMinimumDateTime(start_date_time);
    ui->endDateTimeEdit->setMaximumDateTime(end_date_time);

    ui->startDateTimeEdit_2->setDisplayFormat("yyyy-M-d HH");
    ui->endDateTimeEdit_2->setDisplayFormat("yyyy-M-d HH");
    ui->startDateTimeEdit_2->setMinimumDateTime(start_date_time);
    ui->startDateTimeEdit_2->setMaximumDateTime(end_date_time);
    ui->endDateTimeEdit_2->setMinimumDateTime(start_date_time);
    ui->endDateTimeEdit_2->setMaximumDateTime(end_date_time);

    ui->startDateTimeEdit_3->setDisplayFormat("yyyy-M-d HH");
    ui->endDateTimeEdit_3->setDisplayFormat("yyyy-M-d HH");
    ui->startDateTimeEdit_3->setMinimumDateTime(start_date_time);
    ui->startDateTimeEdit_3->setMaximumDateTime(end_date_time);
    ui->endDateTimeEdit_3->setMinimumDateTime(start_date_time);
    ui->endDateTimeEdit_3->setMaximumDateTime(end_date_time);

    ui->startDateTimeEdit_4->setDisplayFormat("yyyy-M-d HH");
    ui->endDateTimeEdit_4->setDisplayFormat("yyyy-M-d HH");
    ui->startDateTimeEdit_4->setMinimumDateTime(start_date_time);
    ui->startDateTimeEdit_4->setMaximumDateTime(end_date_time);
    ui->endDateTimeEdit_4->setMinimumDateTime(start_date_time);
    ui->endDateTimeEdit_4->setMaximumDateTime(end_date_time);
}
开发者ID:Mr-Phoebe,项目名称:QT-learning,代码行数:58,代码来源:control.cpp


示例16: rtLevelUpdate

void rtLevelUpdate(int level)
{
  start_time(RT_LEVEL_UPDATE_TIMER);

#ifdef RT_TRANSFER
  rtLevelUpdateTransfer(level);
#endif

  end_time(RT_LEVEL_UPDATE_TIMER);
}
开发者ID:sleitner,项目名称:cart,代码行数:10,代码来源:rt_step.c


示例17: rtAfterAssignDensity2

void rtAfterAssignDensity2(int level, int num_level_cells, int *level_cells)
{
  start_time(RT_AFTER_DENSITY_TIMER);

#ifdef RT_TRANSFER
  rtAfterAssignDensityTransfer(level,num_level_cells,level_cells);
#endif

  end_time(RT_AFTER_DENSITY_TIMER);
}
开发者ID:sleitner,项目名称:cart,代码行数:10,代码来源:rt.c


示例18: solveNonadaptive

/** Nonadaptive solver.*/
void solveNonadaptive(Mesh &mesh, NonlinSystem &nls,
                      Solution &Cp, Solution &Ci, Solution &phip, Solution &phii) {
    begin_time();

    //VectorView vview("electric field [V/m]", 0, 0, 600, 600);
    ScalarView Cview("Concentration [mol/m3]", 0, 0, 800, 800);
    ScalarView phiview("Voltage [V]", 650, 0, 600, 600);

#ifdef CONT_OUTPUT
    phiview.show(&phii);
    Cview.show(&Ci);
    Cview.wait_for_keypress();
#endif
    Solution Csln, phisln;
    for (int n = 1; n <= NSTEP; n++) {

#ifdef VERBOSE
        info("\n---- Time step %d ----", n);
#endif

        int it = 1;
        double res_l2_norm;

        do {

#ifdef VERBOSE
            info("\n -------- Time step %d, Newton iter %d --------\n", n, it);
#endif
            it++;
            nls.assemble();
            nls.solve(2, &Csln, &phisln);
            res_l2_norm = nls.get_residuum_l2_norm();

#ifdef VERBOSE
            info("Residuum L2 norm: %g\n", res_l2_norm);
#endif

            Ci.copy(&Csln);
            phii.copy(&phisln);

        } while (res_l2_norm > NEWTON_TOL);
#ifdef CONT_OUTPUT
        phiview.show(&phii);
        Cview.show(&Ci);
#endif
        phip.copy(&phii);
        Cp.copy(&Ci);
    }
    verbose("\nTotal run time: %g sec", end_time());
    Cview.show(&Ci);
    phiview.show(&phii);
    //MeshView mview("small.mesh", 100, 30, 800, 800);
    //mview.show(&mesh);
    View::wait();
}
开发者ID:Zhonghua,项目名称:hermes2d,代码行数:56,代码来源:main.cpp


示例19: copy_potential

void copy_potential( int level ) {
	int i;
	int icell;
	int num_level_cells;
	int *level_cells;

	start_time( GRAVITY_TIMER );
	start_time( WORK_TIMER );

	select_level( level, CELL_TYPE_ANY, &num_level_cells, &level_cells );
#pragma omp parallel for default(none), private(i,icell), shared(num_level_cells,level_cells,cell_vars)
	for ( i = 0; i < num_level_cells; i++ ) {
		icell = level_cells[i];
		cell_potential_hydro(icell) = cell_potential(icell);
	}
	cart_free( level_cells );

	end_time( WORK_TIMER );
	end_time( GRAVITY_TIMER );
}
开发者ID:sleitner,项目名称:cart,代码行数:20,代码来源:gravity_step.c


示例20: rtUpdateTables

/* This function can be called more than once per top level step */ 
void rtUpdateTables()
{
#ifdef RT_TRANSFER
  int i;
  frt_real rfAvg[rt_num_fields];

  for(i=0; i<rt_num_fields; i++) rfAvg[i] = rtAvgRF[i].Value;

#else
  frt_real *rfAvg = NULL;
#endif

  start_time(RT_TABLES_TIMER);
  start_time(WORK_TIMER);

  /* Fill in the tables */
  frtCall(updatetables)(rfAvg);

  end_time(WORK_TIMER);
  end_time(RT_TABLES_TIMER);
}
开发者ID:sleitner,项目名称:cart,代码行数:22,代码来源:rt.c



注:本文中的end_time函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ end_update函数代码示例发布时间:2022-05-30
下一篇:
C++ end_request函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap