本文整理汇总了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;
}
示例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);
}
示例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());
}
示例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());
}
示例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));
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}