当前位置: 首页>>代码示例>>C++>>正文


C++ SetTime函数代码示例

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


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

示例1: SetTime

UINT	TimeManager::CurrentDate()
{
	__ENTER_FUNCTION

		SetTime( ) ;
	UINT Date;
	ConvertTU(&m_TM,Date);

	return Date;

	__LEAVE_FUNCTION

		return 0;
}
开发者ID:uvbs,项目名称:wx2Server,代码行数:14,代码来源:TimeManager.cpp

示例2: TEST

TEST(time, timer_create_NULL) {
  // A NULL sigevent* is equivalent to asking for SIGEV_SIGNAL for SIGALRM.
  timer_t timer_id;
  ASSERT_EQ(0, timer_create(CLOCK_MONOTONIC, NULL, &timer_id));

  ScopedSignalHandler ssh(SIGALRM, timer_create_NULL_signal_handler);

  ASSERT_EQ(0, timer_create_NULL_signal_handler_invocation_count);

  SetTime(timer_id, 0, 1, 0, 0);
  usleep(500000);

  ASSERT_EQ(1, timer_create_NULL_signal_handler_invocation_count);
}
开发者ID:Acidburn0zzz,项目名称:platform_bionic,代码行数:14,代码来源:time_test.cpp

示例3: GenerateInput

// Write a function that fills the gData array with random numbers between 1 and MAX_RANDOM_NUMBER
// If indexForZero is valid and non-negative, set the value at that index to zero 
void GenerateInput(int size, int indexForZero) {
	printf("Filling Array...\n");
	int i;
	SetTime();
	for(i=0; i < size; i++){
		if(indexForZero > 0 && indexForZero == i){
			gData[i] = 0;
		}else{
			gData[i] = GetRand(1,MAX_RANDOM_NUMBER);
		}	
	}
	printf("%d\r",i);
	printf("Array Fill took %lu ms \n",GetTime());
}
开发者ID:robertrico,项目名称:School,代码行数:16,代码来源:MTFindMin.c

示例4: Zeit

func Zeit(int iZeit)
{
	CanClose = 1;
	CloseMenu(GetCursor());
	Log("<c ffcc00>%d Minuten Aufbauzeit</c>",iZeit);
	SetTime(iZeit,0);
	CreateMenu(MEPU, GetCursor(), 0, 0,"Geldeinstellungen", 0, 1,1,17);
	CanClose = 0;
	AddMenuItem("100 Clunker", Format("Geld(%d)",100),MEPU, GetCursor());
	AddMenuItem("200 Clunker", Format("Geld(%d)",200),MEPU, GetCursor());
	AddMenuItem("500 Clunker", Format("Geld(%d)",500),MEPU, GetCursor());
	AddMenuItem("1000 Clunker", Format("Geld(%d)",1000),MEPU, GetCursor());
	AddMenuItem("2000 Clunker", Format("Geld(%d)",2000),MEPU, GetCursor());
}
开发者ID:Fulgen301,项目名称:SGGP,代码行数:14,代码来源:Script.c

示例5: sscanf

//初始化
void CExtraExpActivity::Init(int nActivityID, const char * szBeginTime, const char * szEndTime,
							 const char * szStartTime, const char * szStopTime, unsigned short nReewardExpRate)
{
	int nStartHour = 0;
	int nStartMinute = 0;
	sscanf(szStartTime, "%2d:%2d", &nStartHour, &nStartMinute);
	int nStopHour = 0;
	int nStopMinute = 0;
	sscanf(szStopTime, "%2d:%2d", &nStopHour, &nStopMinute);

	m_nActivityID = nActivityID;
	m_nRewardExpRate = nReewardExpRate;
	CDayTimeBlockActivity::Init(nStartHour, nStartMinute, nStopHour, nStopMinute, SetTime(szBeginTime), SetTime(szEndTime));
}
开发者ID:yzfrs,项目名称:ddianle_d1,代码行数:15,代码来源:ExtraExpActivity.cpp

示例6: SetTime

void FAnimLinkableElement::LinkSequence(UAnimSequenceBase* Sequence, float AbsSequenceTime)
{
	if(Sequence && Sequence->SequenceLength > 0)
	{
		LinkedMontage = nullptr;
		LinkedSequence = Sequence;
		SegmentIndex = 0;

		SegmentBeginTime = 0.0f;
		SegmentLength = Sequence->SequenceLength;

		SetTime(AbsSequenceTime);
	}
}
开发者ID:amyvmiwei,项目名称:UnrealEngine4,代码行数:14,代码来源:AnimLinkableElement.cpp

示例7: AddEvent

	void EventComponent::AddEvent(shared_ptr<Event> event)
	{
		if (event->GetEventType() != EVT_MOVE)
			mEventList[event->GetEventType()].push_back(event);
		else // Unpack move events.
		{
			auto mov = static_pointer_cast<MoveEvent>(event);
			auto mxe = make_shared<MoveXEvent>();
			auto mye = make_shared<MoveYEvent>();
			
			mxe->SetTime(event->GetTime());
			mye->SetTime(event->GetTime());
			mxe->SetEndTime(event->GetEndTime());
			mye->SetEndTime(event->GetEndTime());

			mxe->SetValue(mov->GetValue().x);
			mye->SetValue(mov->GetValue().y);
			mxe->SetEndValue(mov->GetEndValue().x);
			mye->SetEndValue(mov->GetEndValue().y);

			mEventList[mxe->GetEventType()].push_back(mxe);
			mEventList[mye->GetEventType()].push_back(mye);
		}
	}
开发者ID:mechacrash,项目名称:raindrop,代码行数:24,代码来源:osuBackgroundAnimation.cpp

示例8: Notify

   virtual Bool_t Notify()
   {
      // stop timer
      TurnOff();

      // so some action here
      TDatime d;
      m_label->SetText(d.AsString());
      gEve->GetDefaultGLViewer()->RequestDraw();

      // start timer
      SetTime(1000);
      Reset();
      TurnOn();
      return true;
   }
开发者ID:adevress,项目名称:root-1,代码行数:16,代码来源:annotation.C

示例9: GetTimes

/******************************Public*Routine******************************\
* Run
\**************************************************************************/
HRESULT CVMR9Subgraph::Run()
{
    HRESULT hr = S_OK;

    if( !m_pMc )
    {
        return E_UNEXPECTED;
    }
	LONGLONG  llCur= 0; LONGLONG  llDur = 0;
	hr = GetTimes(llCur,  llDur);
	if(llCur == llDur)
		SetTime(0);
    hr = m_pMc->Run();

    return hr;
}
开发者ID:Strongc,项目名称:game-ui-solution,代码行数:19,代码来源:VMR9Subgraph.cpp

示例10: atoi

bool Time::SetDate ( std::string line )
{
	int hr, min, m, d, y;
	std::string dat;
	if ( line.substr ( 0, 1 ) == " " ) 
		dat = line.substr ( 1, line.length()-1 ).c_str();
	else 
		dat = line;

	hr = 0;
	min = 0;
	m = atoi ( dat.substr ( 0, 2).c_str () );
	d = atoi ( dat.substr ( 3, 2).c_str () );
	y = atoi ( dat.substr ( 6, 4).c_str () );
	return SetTime ( hr, min, m, d, y);
}
开发者ID:Gfans,项目名称:fluids3,代码行数:16,代码来源:app_perf.cpp

示例11: switch

bool Demo::HandleEvent( sf::Event &e )
{
    if( e.Type == sf::Event::KeyPressed ) {
        switch( e.Key.Code ) {
            case( sf::Key::Return ):
                Reset();
                break;
            case sf::Key::Space:
                Toggle();
                break;
            case sf::Key::G:
                SetTime( 10.0 );
                break;
            case sf::Key::Num1:
                SetSpeed( 0.5 );
                break;
            case sf::Key::Num2:
                SetSpeed( 1.0 );
                break;
            case sf::Key::Num3:
                SetSpeed( 2.0 );
                break;
            case sf::Key::S:
                ShuffleNext();
                break;
            case sf::Key::C:
                ++count;
                Tree::debug_persist( "persist", "count %d", count );
                break;
            case sf::Key::R:
                Tree::debug_remove( "persist" );
                break;
            case sf::Key::F10:
                Tree::exit();
                break;
            case sf::Key::Q:
                BOOST_ASSERT(!"DIE DIE DIE");
                break;
            /*case sf::Key::W:
                BOOST_ASSERT_MSG(1 == 0, "Slower death\n");
                break;*/
            default:
                break;
        }
    }
    return true;
}
开发者ID:treeman,项目名称:7days,代码行数:47,代码来源:Demo.cpp

示例12: _F4_Handler

//Set time on the internal timer
static int _F4_Handler (void)
{
	TimeAndDate CurrentTime;
	//<year> <month> <day> <dow> <hr> <min> <sec>
	CurrentTime.year	= argAsInt(1);
	CurrentTime.month	= argAsInt(2);
	CurrentTime.day		= argAsInt(3);
	CurrentTime.dow		= argAsInt(4);
	CurrentTime.hour	= argAsInt(5);
	CurrentTime.min		= argAsInt(6);
	CurrentTime.sec		= argAsInt(7);
	SetTime(CurrentTime);
	printf_P(PSTR("Setting %02u/%02u/%04u %02u:%02u:%02u"), CurrentTime.month, CurrentTime.day, CurrentTime.year, CurrentTime.hour, CurrentTime.min, CurrentTime.sec);
	
	printf_P(PSTR("......Done\n"));
	return 0;
}
开发者ID:ilikecake,项目名称:Environmental-Sensor,代码行数:18,代码来源:commands.c

示例13: CTalkMystia1

//全体動作
int CBossMystiaMiddle::Thread(){
	TSunFunctionCallback<CBossMystiaMiddle> fn;
	TSunFunctionCallback<CBossMystiaBase> fnb;

	//出現
	flag = 0;
	deffence = 0;
/*
	for( int i = 0; i < 46; i++ ){
		x -= 5;
		mt3.Suspend();
	}
	mt3.Suspend(30);
*/
	//会話
	g_pPlayer->Talk();
	pTalk = new CTalkMystia1();
	pTalk->Start();
	while( !pTalk->IsEnd() )
		mt3.Suspend();
	SAFE_DELETE(pTalk);
	g_pPlayer->Resume();

	//通常攻撃
	SetHP(1000);
	SetTime(20);
	fnb.SetFunction(this,&CBossMystiaBase::NormalAtack1);
	mt.Start(&fnb,0x8000);
	while( !IsEnd() ) mt3.Suspend();
	mt.Stop();

	this->AddItem(ITEM_1UP,1);

	//エフェクト
	flag = 0;
	deffence = 0;
	g_lEffect.Add( new CEffectBreak( GetX(), GetY() ));
	mt3.Suspend( 60 );

	//退却
	for( int i = 0; i < 46; i++ ){
		x += 5;
		mt3.Suspend();
	}
	return 1;
}
开发者ID:yohokuno,项目名称:tbm,代码行数:47,代码来源:Mystia.cpp

示例14: while

XBOOL XTime::SetTime(XString8 &strTime)
{
	//int id=strTime.Find(',');
	//if(id<3) return XFALSE;
	XU32 is=0,id=0;
	XU16 nYear=0,nMon=0,nDay=0,nHour=0,nMin=0,nSec=0;
	while(id<=strTime.GetLength())
	{
		if(strTime[id]==' '||strTime[id]==','||strTime[id]=='-'||strTime[id]==0)
		{
			if(id>is+1)
			{
				XString8 str;
				strTime.Mid(str,is,id-is);
				XString8Array list;
				list.SplitString(str,':');
				if(list.GetSize()>1)
				{
					nHour=list[0].ToInt();
					nMin=list[1].ToInt();
					if(list.GetSize()>2)
						nSec=list[2].ToInt();
				}
				else 
				{
					int id=Month(str);
					if(id>0&&id<=12&&nMin<1) nMon=id;
					else 
					{
						id=str.ToInt();
						if(id>0&&id<32&&nDay<1) nDay=id;
						else if(id>=1900) nYear=id;
						else nHour=id;
					}
				}
			}
			id++;
			is=id;
		}
		id++;
	}
	if(nYear<1900||nMon<1||nDay<1) return XFALSE;
	SetTime(nYear,nMon,nDay,nHour,nMin,nSec);
	return XTRUE;
}
开发者ID:hgl888,项目名称:nashtest,代码行数:45,代码来源:XTime.cpp

示例15: switch

void CMdbPara::SetNumber(register uint32 nFieldNo, register void* pVal, register uint32 nOperator)
{
	switch(GetType(nFieldNo))
	{
	case MDB_INT8_FIELD:
		SetInt8(nFieldNo, *(int8*)pVal, nOperator);
		break;
	case MDB_INT16_FIELD:
		SetInt16(nFieldNo, *(int16*)pVal, nOperator);
		break;
	case MDB_INT32_FIELD:
		SetInt32(nFieldNo, *(int32*)pVal, nOperator);
		break;
	case MDB_INT64_FIELD:
		SetInt64(nFieldNo, *(int64*)pVal, nOperator);
		break;
	case MDB_UINT8_FIELD:
		SetUInt8(nFieldNo, *(uint8*)pVal, nOperator);
		break;
	case MDB_UINT16_FIELD:
		SetUInt16(nFieldNo, *(uint16*)pVal, nOperator);
		break;
	case MDB_UINT32_FIELD:
		SetUInt32(nFieldNo, *(uint32*)pVal, nOperator);
		break;
	case MDB_UINT64_FIELD:
		SetUInt64(nFieldNo, *(uint64*)pVal, nOperator);
		break;
	case MDB_FLOAT_FIELD:
		SetFloat(nFieldNo, *(float*)pVal, nOperator);
		break;
	case MDB_DOUBLE_FIELD:
		SetDouble(nFieldNo, *(double*)pVal, nOperator);
		break;
	case MDB_DATE_FIELD:
		SetDate(nFieldNo, *(CDate*)pVal, nOperator);
		break;
	case MDB_TIME_FIELD:
		SetTime(nFieldNo, *(CTime*)pVal, nOperator);
		break;
	case MDB_DATETIME_FIELD:
		SetDateTime(nFieldNo, *(CDateTime*)pVal, nOperator);
		break;
	}
}
开发者ID:nightstyles,项目名称:focp,代码行数:45,代码来源:MdbApi.cpp


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