您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ time_GetTime函数代码示例

51自学网 2021-06-03 08:50:25
  C++
这篇教程C++ time_GetTime函数代码示例写得很实用,希望能帮到您。

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

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

示例1: tlog_qual_to_time

static pwr_tStatus tlog_qual_to_time( 	char 		*in_str, 					pwr_tTime 	*time){	pwr_tStatus	sts;	char		*s;	pwr_tDeltaTime	one_day_time;	pwr_tTime	current_time;	char			str[64];	char			timstr[64];	if ( !strcmp( in_str, "") ||	     !strncmp( in_str, "TODAY", strlen(in_str)))	{	  time_GetTime( &current_time);	  time_AtoAscii( &current_time, time_eFormat_DateAndTime,			timstr, sizeof(timstr));	  timstr[12] = 0;	  strcat( timstr, " 00:00:00.00");	  sts = time_AsciiToA( timstr, time);	}	else if ( !strncmp( in_str, "YESTERDAY", strlen(in_str)))	{	  time_GetTime( &current_time);	  time_AtoAscii( &current_time, time_eFormat_DateAndTime,			timstr, sizeof(timstr));	  timstr[12] = 0;	  strcat( timstr, " 00:00:00.00");	  sts = time_AsciiToA( timstr, &current_time);	  strcpy( timstr, "1 00:00:00");	  sts = time_AsciiToD( timstr, &one_day_time);	  time_Dneg( &one_day_time, &one_day_time);	  time_Aadd( time, &current_time, &one_day_time);	}	else	{	  strcpy( str, in_str);	  if ( s = strchr( str, '-'))	  {	    /* Date is supplied, replace ':' to space */	    if ( s = strchr( str, ':'))	      *s = ' ';	    strcpy( timstr, str);	  }	  else	  {	    /* No date is supplied, add current date as default */	    time_GetTime( &current_time);	    time_AtoAscii( &current_time, time_eFormat_DateAndTime,			timstr, sizeof(timstr));	    timstr[12] = 0; 	    strcat( timstr, " "); 	    strcat( timstr, str);	  }	  sts = time_AsciiToA( timstr, time);	  if (EVEN(sts)) return sts;	}	return TLOG__SUCCESS;}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:59,


示例2: RunTimeCounterFo_exec

void RunTimeCounterFo_exec( plc_sThread		*tp,			    pwr_sClass_RunTimeCounterFo  *o){  pwr_tDeltaTime	TimeSince;  pwr_sClass_RunTimeCounter *co = (pwr_sClass_RunTimeCounter *) o->PlcConnectP;  if ( !co)    return;  if ( *o->ResetP && !o->OldReset)    co->TripReset = 1;  time_FloatToD( &TimeSince, *o->ScanTime);  /* Test if New Trip */  if (co->TripReset) {    co->OldTripNOfStarts = co->TripNOfStarts;    co->OldTripUsage = co->TripUsage;    co->OldTripTime = co->TripTime;    co->OldTripRunTime = co->TripRunTime;    co->TripNOfStarts = 0;    co->TripRunTime.tv_sec = co->TripRunTime.tv_nsec = 0;    co->TripTime.tv_sec = co->TripTime.tv_nsec = 0;    time_GetTime( &co->ResetTime);    co->TripReset = 0;  }  /* Update Calendar time */  time_Dadd( &co->TotalTime, &co->TotalTime, &TimeSince);  time_Dadd( &co->TripTime, &co->TripTime, &TimeSince);  /* Test if running */  o->Start = 0;  if (*o->RunningP) {    /* New start ? */    if ( !o->Running) {      o->Start = 1;      co->TotalNOfStarts++;      co->TripNOfStarts++;      time_GetTime( &co->StartTime);    } /* End if new start */    /* Update Running Time */    time_Dadd( &co->TripRunTime, &co->TripRunTime, &TimeSince);    time_Dadd( &co->TotalRunTime, &co->TotalRunTime, &TimeSince);  } /* End if Running */  o->Running = co->Running = *o->RunningP;  /* Calculate usage % */  if ( co->TotalRunTime.tv_sec)    co->TotalUsage = ((float)co->TotalRunTime.tv_sec) / co->TotalTime.tv_sec * 100;  if ( co->TripTime.tv_sec)    co->TripUsage = ((float)co->TripRunTime.tv_sec) / co->TripTime.tv_sec * 100;  o->OldReset = *o->ResetP;}
开发者ID:jordibrus,项目名称:proview,代码行数:57,


示例3: time_GetTime

bool wb_session::commit(){  if (!m_vrep->erep()->check_lock((char*)m_vrep->name(), m_vrep->dbtype())) {    m_sts = LDH__LOCKSTOLEN;    return false;  }  // Store time in volume object  pwr_tOid oid = pwr_cNOid;  pwr_tTime time;  time_GetTime(&time);  oid.vid = m_vrep->vid();  wb_orep* orep = m_vrep->object(&m_sts, oid);  if (oddSts()) {    orep->ref();    wb_attribute modtime(m_sts, orep, "SysBody", "Modified");    if (modtime.oddSts())      writeAttribute(modtime, &time);    orep->unref();  }  return m_srep->commit(&m_sts);}
开发者ID:siamect,项目名称:proview,代码行数:25,


示例4: ClearGraphicsBenchmarkingInfo

//-----------------------------------------------------------------------------LTRESULT CLTBenchmarkMgr::StartGraphicsBenchmarking(LTFLOAT fTestDuration){    // If we're already benchmarking, return    if (m_bIsGraphicsBenchmarking)        return LT_ERROR;    // Re-init our results struct    ClearGraphicsBenchmarkingInfo();    m_ltBenchGraphicsTest.m_dwMinFrameRate = MAX_DWORD;    m_ltBenchGraphicsTest.m_dwMinPolyCount = MAX_DWORD;    // Keep track of our state    m_bIsGraphicsBenchmarking = LTTRUE;    // Determine when we need to end    m_fGraphicsTestDuration = fTestDuration;    m_dwGraphicsTestCurrentTime = (uint32)time_GetTime();    m_dwGraphicsTestStartTime = m_dwGraphicsTestCurrentTime;    m_dwGraphicsTestEndTime = 0;    if (m_fGraphicsTestDuration > 0.0f)        m_dwGraphicsTestEndTime = m_dwGraphicsTestStartTime + (uint32)(1000 * fTestDuration);    m_dwUpdateCount = 0;    m_dwFrameCount = 0;    m_dwPolyCount = 0;        return LT_OK;}
开发者ID:Joincheng,项目名称:lithtech,代码行数:29,


示例5: connect_alarm

int rt_sysmon::alarm_send( pwr_tOid  oid, 			      char	*alarm_text,			      char	*alarm_name,			      int	alarm_prio ) {  mh_sApplMessage 	mh_msg;  pwr_tUInt32	  	mh_id;   int			sts;    sts = connect_alarm();  if ( EVEN(sts)) return sts;	  mh_msg.Object = oid;  mh_msg.EventFlags = (mh_mEventFlags)(mh_mEventFlags_Returned |    mh_mEventFlags_NoObject |     mh_mEventFlags_Bell);  time_GetTime( &mh_msg.EventTime);  mh_msg.SupObject = pwr_cNObjid;  mh_msg.Outunit = pwr_cNObjid;  strcpy ( mh_msg.EventName , alarm_name);  strcpy ( mh_msg.EventText , alarm_text);  mh_msg.EventType = mh_eEvent_Alarm;  mh_msg.SupInfo.SupType = mh_eSupType_None;   mh_msg.EventPrio = (mh_eEventPrio) alarm_prio;  sts = mh_ApplMessage( &mh_id, &mh_msg);  if( EVEN(sts)) return sts;    return SMON__SUCCESS;} 
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:29,


示例6: mh_BlockDbGet

mh_sBlockDb *mh_BlockDbGet (  mh_sBlockDb *dp,  pwr_tUInt32 *size,  char *buffer){  register mh_sBlockDbHead *hp = &dp->Head;  char msg[512];  time_GetTime(&hp->GetTime);  hp->GetCount++;  if (fseek(dp->File, hp->SectPos, SEEK_SET) != 0) goto error;  if (fread(buffer, hp->SegSize, 1, dp->File) != 1) goto error;  *size = hp->SegSize;  return(dp);error:#if defined OS_VMS || defined OS_ELN  sprintf(msg, "BlockDbGet: %s", strerror(errno, vaxc$errno));#else  sprintf(msg, "BlockDbGet: %s", strerror(errno));#endif  Log(msg);  return mh_BlockDbClose(dp);}
开发者ID:Strongc,项目名称:proview,代码行数:28,


示例7: time_GetTime

void sev_repair::clean_item( int idx, int print_idx){  pwr_tTime currenttime, limit;  time_GetTime(&currenttime);  if ( m_db->m_items[idx].deleted)    return;  if ( m_db->m_items[idx].storagetime.tv_sec == 0)    return;  time_Asub( &limit, &currenttime, &m_db->m_items[idx].storagetime);  if( m_db->m_items[idx].attrnum > 1 ) {    if ( print_idx)      printf( "-- Processing %d (%u) %s/n", idx, m_db->m_items.size(), m_db->m_items[idx].tablename);    else      printf( "-- Processing %s/n", m_db->m_items[idx].tablename);    m_db->delete_old_objectdata( &m_sts, m_db->m_items[idx].tablename,                                  m_db->m_items[idx].options, limit, m_db->m_items[idx].scantime, (float)0xEFFFFFFF);  }  else {    if ( print_idx)      printf( "-- Processing %d (%u) %s/n", idx, m_db->m_items.size(), m_db->m_items[idx].tablename);    else      printf( "-- Processing %s/n", m_db->m_items[idx].tablename);    m_db->delete_old_data( &m_sts, m_db->m_items[idx].tablename,          m_db->m_items[idx].options, limit, m_db->m_items[idx].scantime, (float)0xEFFFFFFF);  }}
开发者ID:Strongc,项目名称:proview,代码行数:30,


示例8: pwrs_Node_SupEmon

/* Supervise emon server process */voidpwrs_Node_SupEmon (){  int i = errh_eAnix_emon - 1;  pwr_tTime current_time;  pwr_tDeltaTime diff;  static float timeout = 3;  if ( !np) {    pwr_tOid oid;    pwr_tStatus sts;    sts = gdh_GetNodeObject( 0, &oid);    if ( ODD(sts))      gdh_ObjidToPointer( oid, (void **) &np);    if ( EVEN(sts)) return;  }  if ( !np)    return;  if ( np->ProcStatus[i] != 0 && np->ProcStatus[i] != PWR__PTIMEOUT) {    time_GetTime( &current_time);    time_Adiff( &diff, &current_time, &np->ProcTimeStamp[i]);    if ( time_DToFloat( 0, &diff) > timeout) {      if ( errh_Severity( np->ProcStatus[i]) < errh_Severity(PWR__PTIMEOUT)) {	np->ProcStatus[i] = PWR__PTIMEOUT;	np->SystemStatus = PWR__PTIMEOUT;      }    }  }}
开发者ID:Strongc,项目名称:proview,代码行数:35,


示例9: detect

static void detect (  pwr_sClass_NodeLinkSup *o,  pwr_tBoolean con,  sNode *np){  /* For DSup we compare with control position, but for NodeLink     we only detect LinkDown  */  if (o->LinkUp) {    if (o->Action) o->Action = FALSE;    if (o->ReturnCheck) {      time_GetTime(&o->ReturnTime);      o->ReturnCheck = FALSE;      o->ReturnSend = TRUE;    }    if (o->AlarmCheck && !o->DetectCheck) {      o->TimerFlag = FALSE;      o->DetectCheck = TRUE;    }  } else if (con) {    if (!o->Action) o->Action = TRUE;    if (o->AlarmCheck && o->DetectOn && !o->Blocked) {      if (o->DetectCheck) {	o->TimerCount = (o->TimerTime * 1000) / cTimerTimeDetect;	if (!o->TimerFlag && o->TimerCount > 0) {	  if (!LstInl(&np->timer_l)) {	    LstIns(&timer_l, np, timer_l);	  }	  o->TimerFlag = TRUE;	}	time_GetTime(&o->DetectTime);	o->DetectCheck = FALSE;      }      if (!o->TimerFlag) {	o->DetectSend = TRUE;	o->ReturnCheck = TRUE;	o->Acked = FALSE;	o->AlarmCheck = FALSE;      }    }  }}
开发者ID:jordibrus,项目名称:proview,代码行数:45,


示例10: pkg_random

static unsigned int pkg_random(){  pwr_tTime t;  time_GetTime( &t);  int itime = t.tv_nsec + t.tv_sec % 10000;  srand( itime);  return (unsigned int)((double) rand() / ((double) RAND_MAX + 1) * 999999);}
开发者ID:Strongc,项目名称:proview,代码行数:10,


示例11: logg_get_filename

/*************************************************************************** Name:		logg_get_filename** Typ		int** Typ		Parameter	IOGF	Beskrivning** Beskrivning: *	Adderar extention till filname om det saknas.***************************************************************************/static int	logg_get_filename(			char	*inname,			char	*outname,			char	*ext){	char	*s;	char	*s2;	pwr_tFileName	timestr;	char	comp_timestr[80];	pwr_tTime time;	dcli_translate_filename( outname, inname);	/* Look for extension in filename */	if ( ext != NULL)	{	  s = strrchr( outname, ':');	  if ( s == 0)	    s = outname;	  s2 = strrchr( s, '>');	  if ( s2 == 0)	  {	    s2 = strrchr( s, ']');	    if ( s2 == 0)	      s2 = s;	  }	  s = strrchr( s2, '.');	  if ( s != 0)	    *s = 0;	  strcat( outname, ext);	}#if defined OS_LYNX || defined OS_LINUX	  /* Get current time to use as "version number" */          time_GetTime( &time);	  time_AtoAscii( &time, time_eFormat_ComprDateAndTime, timestr, 			sizeof(timestr));	  comp_timestr[0] = '.';	  memcpy(&comp_timestr[1], &timestr[0], 2);	  memcpy(&comp_timestr[3], &timestr[3], 2);	  memcpy(&comp_timestr[5], &timestr[6], 2);	  memcpy(&comp_timestr[7], &timestr[9], 2);	  memcpy(&comp_timestr[9], &timestr[12], 2);	  memcpy(&comp_timestr[11], &timestr[15], 2);	  comp_timestr[13] = 0;//	  strcat(outname, comp_timestr);#endif	return REM__SUCCESS;}
开发者ID:hfuhuang,项目名称:proview,代码行数:66,


示例12: logg

static void logg( const char *str){  pwr_tTime t;  char timstr[40];  time_GetTime( &t);  time_AtoAscii( 0, time_eFormat_Time, timstr, sizeof(timstr));  timstr[9] = 0;  fprintf( fp, "%s%04lld %s/n", timstr, t.tv_nsec/100000, str);}
开发者ID:Strongc,项目名称:proview,代码行数:11,


示例13: b

bool wb_db::importRbody(pwr_tOid oid, size_t size, void *body){  wb_db_rbody b(this, oid, size, body);  wb_db_ohead oh(this, oid);  pwr_tTime time;  time_GetTime(&time);  oh.get(m_txn);  oh.rbTime(time);  oh.put(m_txn);  b.put(m_txn);  return true;}
开发者ID:jordibrus,项目名称:proview,代码行数:12,


示例14: b

bool wb_dbms::importDbody(pwr_tOid oid, size_t size, void *body){    wb_dbms_dbody b(this, oid, size, body);    wb_dbms_ohead oh(this, oid);    pwr_tTime time;    time_GetTime( &time);    oh.get(m_txn);    oh.dbTime(time);    oh.upd(m_txn);    b.ins(m_txn);    return true;}
开发者ID:jordibrus,项目名称:proview,代码行数:12,


示例15: logg_open_file

static pwr_tStatus	logg_open_file( logg_t_loggconf_list	*conflist_ptr,					int			first_time){	int			csts;	char			filename[80];	pwr_tTime		time;	char			timestr[80];	if ( !first_time)	{	  /* Check if it's time for a new try to open the file */	  conflist_ptr->wait_count++;	  if (conflist_ptr->wait_count < 10)	    return REM__SUCCESS;	  conflist_ptr->wait_count = 0;	}	/* Open file */	logg_get_filename( conflist_ptr->loggconf->LoggFile,			filename, LOGG_FILE_EXT);#if defined OS_LYNX || defined OS_LINUX	conflist_ptr->outfile = fopen( filename, "a+");#else	conflist_ptr->outfile = fopen( filename, "w+", "shr=get");#endif	if (conflist_ptr->outfile != NULL)	{	  /* Write a file header */          time_GetTime( &time);	  time_AtoAscii( &time, time_eFormat_DateAndTime, timestr, 		sizeof(timestr));	  csts = fprintf( conflist_ptr->outfile,			"RemLogg file opened at %s/n/n", timestr);	  if (csts >= 0)	  {	    conflist_ptr->loggconf->FileOpenCount++;#if defined OS_ELN || defined OS_VMS	    fgetname( conflist_ptr->outfile, filename);#endif	    errh_CErrLog( REM__LOGGFILEOPEN, errh_ErrArgAF(filename), NULL);	    conflist_ptr->file_open = 1;	    return REM__SUCCESS;	  }	  else	  {	    fclose( conflist_ptr->outfile);	  }	}	errh_CErrLog( REM__LOGGFILE, errh_ErrArgAF(filename), NULL);	return REM__LOGGFILE;}
开发者ID:hfuhuang,项目名称:proview,代码行数:52,


示例16: time_PeriodSec

static void time_PeriodSec( pwr_tTime *from, pwr_tTime *to, pwr_tTime *center, int sec){  pwr_tStatus sts;  pwr_tTime current;  sts = time_GetTime( &current);  to->tv_sec = center->tv_sec + sec/2;  to->tv_nsec = center->tv_nsec;  if ( time_Acomp( to, &current) == 1)    *to = current;  from->tv_sec = to->tv_sec - sec;  from->tv_nsec = to->tv_nsec;}
开发者ID:jordibrus,项目名称:proview,代码行数:13,


示例17: qos_WaitQue

pwr_tBooleanqos_WaitQue (  pwr_tStatus		*status,  qdb_sQue		*qp,  int			tmo){  pwr_tDeltaTime	dtime;  pwr_tTime             atime;  struct timespec       atime_ts;  int			ok;  pwr_tBoolean		signal = FALSE;  pwr_dStatus		(sts, status, QCOM__SUCCESS);  qdb_AssumeLocked;  if (tmo == qcom_cTmoNone)    return FALSE;  pthread_mutex_lock(&qp->lock.mutex);  qp->lock.waiting = TRUE;  qp->lock.pid     = 0;  qdb_Unlock;  if (tmo != qcom_cTmoEternal) {    time_GetTime(&atime);    time_MsToD(&dtime, tmo);    time_Aadd(&atime, &atime, &dtime);    atime_ts.tv_sec = atime.tv_sec;    atime_ts.tv_nsec = atime.tv_nsec;    ok = pthread_cond_timedwait(&qp->lock.cond, &qp->lock.mutex, &atime_ts);  } else {    ok = pthread_cond_wait(&qp->lock.cond, &qp->lock.mutex);  }        pthread_mutex_unlock(&qp->lock.mutex);    qdb_Lock;  if ((qp->lock.waiting) || (ok == ETIMEDOUT)) {    *sts = QCOM__TMO;    qp->lock.waiting = FALSE;  } else {    signal = TRUE;  }  return signal;}
开发者ID:Strongc,项目名称:proview,代码行数:51,


示例18: time_AtoFormAscii

voidtime_AtoFormAscii (  pwr_tTime *ts,  short   dissolution,  short   formType,  char    buf[],  int   bufsize){  int   len;  struct tm *tmpTm;  char   tmphs[16];  pwr_tTime time, *tp;  if (ts == NULL) {    time_GetTime(&time);    tp = &time;  } else {    tp = ts;  }  switch (formType) {  case GB:  case SWE:  default: {    time_t sec = tp->tv_sec;    tmpTm = localtime(&sec);    switch (dissolution) {    case HUNDRED:      len = strftime(buf, bufsize, "%Y-%m-%d %H:%M:%S", tmpTm);      if (len != 0 && len + 4 <= bufsize) {        sprintf(tmphs, ".%02d", (int)(tp->tv_nsec / 10000000));        strcat(buf, tmphs);      }      break;    case MINUTE:      strftime(buf, bufsize, "%Y-%m-%d %H:%M", tmpTm);      break;    case SECOND:    default:      strftime(buf, bufsize, "%Y-%m-%d %H:%M:%S", tmpTm);      break;    }  }  }}
开发者ID:jordibrus,项目名称:proview,代码行数:49,


示例19: time_GetTime

int XttVideoMgmAimetis::check_session(){  pwr_tTime current;  pwr_tDeltaTime timeout = {300,0};  pwr_tDeltaTime dt;  int sts = 1;  // Check that current session hasn't timed out  time_GetTime( &current);  time_Adiff_NE( &dt, &current, &m_last_auth);   if ( time_Dcomp( &dt, &timeout) == 1)    sts = authorize( m_op->User, m_op->Password);  return sts;}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:15,


示例20: time_Os

time_tOs *time_Os (  pwr_tStatus *status,  time_tOs *tp){  static time_tOs os_time;  pwr_dStatus(sts, status, TIME__SUCCESS);  if (tp == NULL)    tp = &os_time;  time_GetTime(tp);  return tp;}
开发者ID:Strongc,项目名称:proview,代码行数:16,


示例21: LTStrCpy

bool CNetMgr::Init(char *pPlayerName){	m_PlayerName[0] = 0;	m_LatentPacketBank.SetCacheSize(256);	m_nDroppedPackets = 0;	m_pCurPrefix = "";	LTStrCpy(m_PlayerName, pPlayerName, sizeof(m_PlayerName));	m_fLastTime = time_GetTime( );	SetAppGuid(LTNULL);	SetMainDriver(LTNULL);	return true;}
开发者ID:Joincheng,项目名称:lithtech,代码行数:16,


示例22: subcm_CheckTimeout

voidsubcm_CheckTimeout (){  pool_sQlink		*cl;  sub_sClient		*cp;  pwr_tTime		curtim;  pwr_tTime		restim;  pwr_tDeltaTime	tmotim;  pwr_tInt32		n;  pwr_tInt32		i;  gdb_AssumeLocked;  gdbroot->db->tmocnt++;  /* Statistics */  time_GetTime( &curtim);  /* Calculate # of remote object clients to process this time */  n = gdbroot->db->subt_lc;  if (n == 0) n = MIN(1, gdbroot->db->subt_lc);  for (i=0; i<n; i++) {    /* Temporarily remove the first entry from the queue for processing.  */    cl = pool_QremoveSucc(NULL, gdbroot->pool, &gdbroot->db->subt_lh);    cp = pool_Qitem(cl, sub_sClient, subt_ll);    /* Find out if the client has timed out */    if (!cp->old) {      /* cp->tmo in 10ths of seconds */      tmotim.tv_sec = cp->tmo / 10;      tmotim.tv_nsec = (cp->tmo - tmotim.tv_sec * 10) * 100000000;      time_Aadd(&restim, &cp->lastupdate, &tmotim);             /* curtim >= tmotim + lastupdate */      if (time_Acomp(&curtim, &restim) >= 0) 	subc_SetOld(cp);    } /* If it was old already */    /* Reinsert the entry last in the queue.  */        pool_QinsertPred(NULL, gdbroot->pool, cl, &gdbroot->db->subt_lh);  }}
开发者ID:Strongc,项目名称:proview,代码行数:47,


示例23: bck_ForceBackup

void bck_ForceBackup (		void **context){  pwr_tInt32 sts;  pwr_tTime *t;#ifdef OS_VMS  $DESCRIPTOR (efcname, BCK_EFC_NAME);#endif/* * Initialize */#ifdef OS_ELN  if (!areas_mapped) {    BCK_MAP_AREAS;    areas_mapped = TRUE;  }#endif/* * Build the context block (i.e. current time) */  if (context != NULL) {    t = malloc (sizeof *t);    time_GetTime(t);    *context = t;  }/* * Kick the backup processes */#ifdef OS_ELN  ker$signal (NULL, bck_forced_activation);#else  sts = sys$ascefc (BCK_EFC, &efcname, 0, 0);  if (EVEN (sts)) lib$signal (sts);  sts = sys$setef (BCK_ACTIVATE);  if (EVEN (sts)) lib$signal (sts);#endif} /* bck_ForceBackup */
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:44,


示例24: time_AtoAscii

pwr_tStatustime_AtoAscii (  pwr_tTime *ts,  time_eFormat  format,  char    *buf,  int   bufsize){  struct tm *tmpTm;  int   buflen;  char    tmpStr[16];  pwr_tTime time;  pwr_tTime *tp;  if (ts == NULL)  {    time_GetTime(&time);    tp = &time;  }  else    tp = ts;  time_t sec = tp->tv_sec;  tmpTm = localtime(&sec);  if (EVEN(time_TmToAscii(tmpTm, format, buf, bufsize)))    return TIME__RANGE;  buflen = strlen(buf);  switch (format) {  case time_eFormat_FileDateAndTime:  case time_eFormat_FileDate:    break;  default:    sprintf(tmpStr, ".%02d", (int)(tp->tv_nsec / 10000000));    if (strlen(tmpStr) + buflen < (unsigned int) bufsize)      strcpy(&buf[buflen], tmpStr);  }  return TIME__SUCCESS;}
开发者ID:jordibrus,项目名称:proview,代码行数:42,


示例25: usbio_reconnect

static int usbio_reconnect( io_tCtx ctx,			    io_sAgent *ap,			    io_sRack *rp,			    io_sCard *cp){  io_sLocal *local = cp->Local;  io_sLocalUSB *localUSB = (io_sLocalUSB *)rp->Local;  pwr_sClass_MotionControl_USBIO *op = (pwr_sClass_MotionControl_USBIO *)cp->op;  pwr_tTime time;  pwr_tDeltaTime diff;  unsigned int snum;  int handle;  int i;  int status;  time_GetTime( &time);  time_Adiff( &diff, &time, &local->ConnectRetry);  if ( time_DToFloat( 0, &diff) > 1.0) {    for ( i = 0; i < (int)sizeof(localUSB->USB_Handle); i++) {      status = USBIO_Open( &handle);      if ( status) break;      status = USBIO_GetSerialNr( &handle, &snum);      if ( snum == op->Super.Address) {	local->USB_Handle = localUSB->USB_Handle[local->Idx] = handle;	op->Status = status;	op->Super.ErrorCount = 0;	IoCardClose( ctx, ap, rp, cp);	IoCardInit( ctx, ap, rp, cp);	errh_Info( "USBIO card reconnected '%s'", cp->Name);	return 1;      }    }  }  return 0;}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:40,


示例26: scan_nodes

static voidscan_nodes (){  LstLink(sNode) *nl;  pwr_tStatus sts;  pwr_tBoolean Old;  pwr_tTime LastUpdate, Timeout, CurrentTime;  pwr_tDeltaTime Delta;  pwr_tBoolean LinkUp;  time_GetTime(&CurrentTime);  for (nl = LstFir(&node_l); nl != LstEnd(&node_l); nl = LstNex(nl)) {    sNode *np = LstObj(nl);    pwr_sClass_NodeLinkSup  *o = np->o;    LinkUp = 0;    sts = gdh_GetSubscriptionOldness (o->SubId, &Old, &LastUpdate, NULL);    if (ODD(sts)) {      /* IF (CurrentTime < LastUpdate + TimeoutTime) THEN LinkUp */      Delta.tv_sec = o->TimeoutTime;      Delta.tv_nsec = 0;      time_Aadd(&Timeout, &LastUpdate, &Delta);      if (time_Acomp(&CurrentTime, &Timeout) < 0) 	LinkUp = 1;      o->SystemStatus = *np->subvalue;    }    if (o->LinkUp && !LinkUp) {      o->LinkUp = 0;      o->DownTime = CurrentTime;      o->SystemStatus = PWR__NETTIMEOUT;    } else if (!o->LinkUp && LinkUp) {      o->LinkUp = 1;      o->UpTime = CurrentTime;      o->UpCount++;    }    detect(o, 1, np);  }}
开发者ID:jordibrus,项目名称:proview,代码行数:40,


示例27: m_oid

wb_dbs::wb_dbs(wb_vrep *v) :  m_oid(pwr_cNOid), m_rtonly(0), m_warnings(0), m_errors(0),  m_nObjects(0), m_nTreeObjects(0), m_nClassObjects(0),  m_nNameObjects(0), m_nRbodyObjects(0), m_nDbodyObjects(0), m_oep(0){  pwr_tStatus sts;  memset(m_fileName, 0, sizeof(m_fileName));  memset(&m_volume, 0, sizeof(m_volume));  memset(m_sect, 0, sizeof(m_sect));      time_GetTime(&m_volume.time);  m_v = v;      m_volume.vid = m_v->vid();  strcpy(m_volume.name, m_v->name());  m_volume.cid = m_v->cid();  //@todo strcpy(m_volume.className, m_ohp->chp->db.name.data);  m_volume.dvVersion = getDvVersion( m_v);   sprintf(m_fileName, dbs_cNameVolume, dbs_cDirectory, cdh_Low(m_v->name()));  dcli_translate_filename(m_fileName, m_fileName);  m_oid_th = tree_CreateTable(&sts, sizeof(pwr_tOid), offsetof(sOentry, o.oid),                              sizeof(sOentry), 1000, tree_Comp_oid);  m_name_th = tree_CreateTable(&sts, sizeof(dbs_sName), offsetof(sNentry, n),                               sizeof(sNentry), 1000, comp_dbs_name);  m_class_th = tree_CreateTable(&sts, sizeof(pwr_tCid), offsetof(sCentry, c),                                sizeof(sCentry), 1000, tree_Comp_cid);  m_vol_th = tree_CreateTable(&sts, sizeof(pwr_tVid), offsetof(sVentry, v.vid),                                sizeof(sVentry), 10, tree_Comp_vid);}
开发者ID:ManfredHerrmann,项目名称:proview,代码行数:38,


示例28: time_Uptime

pwr_tDeltaTime *time_Uptime (  pwr_tStatus *status,  pwr_tDeltaTime *tp,  pwr_tDeltaTime *ap){  pwr_tDeltaTime time;  unsigned long tics;  static pwr_tUInt64 tics_64;  struct tms buff;  static int tics_per_sec = 0;  static pwr_tTime boot_time = {0,0};  static pwr_tDeltaTime max_diff = {0, 20000000};  pwr_tDeltaTime uptime_tics;  pwr_tTime current_time;  pwr_tDeltaTime diff;  static pwr_tUInt16 msb_flips = 0;  static pwr_tBoolean old_high_bit = 0;  pwr_tBoolean high_bit;  lldiv_t uptime_s;  pwr_dStatus(sts, status, TIME__SUCCESS);   if ( !tics_per_sec)    tics_per_sec = sysconf(_SC_CLK_TCK);  if (tp == NULL)    tp = &time;  tics = times(&buff);  high_bit = tics >> (32 - 1);  if (!high_bit && old_high_bit)    msb_flips++;  old_high_bit = high_bit;  tics_64  = ((pwr_tUInt64) msb_flips << 32) | tics;  uptime_s = lldiv(tics_64, (pwr_tInt64) tics_per_sec);    uptime_tics.tv_sec  = (pwr_tInt64) uptime_s.quot;  uptime_tics.tv_nsec = ((pwr_tUInt64) uptime_s.rem) * (1000000000 / tics_per_sec);  // pwr_Assert(tp->tv_sec >= 0 && tp->tv_nsec >= 0);  time_GetTime( &current_time);  if ( !boot_time.tv_sec) {    time_Asub( &boot_time, &current_time, &uptime_tics);    *tp = uptime_tics;  }  else {    time_Adiff( tp, &current_time, &boot_time);    time_Dsub( &diff, tp, &uptime_tics);    time_Dabs(NULL, &diff);    if ( time_Dcomp(&diff, &max_diff) > 0) {      time_Asub( &boot_time, &current_time, &uptime_tics);      *tp = uptime_tics;      if (status != NULL) {        *status = TIME__CLKCHANGE;      }    }  }  if (ap != NULL)    return time_Dadd(tp, tp, ap);  else    return tp;}
开发者ID:Strongc,项目名称:proview,代码行数:67,


示例29: free

static void *mb_receive( void *data){  io_sRack *rp = ((mb_sCondata *)data)->rp;  int l_idx = ((mb_sCondata *)data)->idx;  io_sServerLocal* local = rp->Local;  int c_socket = local->connections[l_idx].c_socket;  pwr_sClass_Modbus_TCP_Server *op = (pwr_sClass_Modbus_TCP_Server *) rp->op;  ssize_t data_size;  rec_buf *rb;  unsigned char fc;  unsigned char exception_code;  ssize_t ssts;  int size_of_msg;  free( data);  op->Connections++;  while ( 1) {    size_of_msg = 0;    data_size = recv(c_socket, rcv_buffer, sizeof(rec_buf), 0);    if ( data_size < 0) {      op->ErrorCount++;      continue;    }    if ( data_size == 0) {      /* Disconnected */      op->Connections--;      close( c_socket);      local->connections[l_idx].occupied = 0;      errh_Error( "Connection lost for IO modbus tcp server %s, %d", rp->Name, c_socket);      return 0;    }    if ( op->DisableServer)      continue;    while ( data_size > 0) {      if (data_size < sizeof(mbap_header))	break;      op->RX_packets++;      rb = (rec_buf *) &rcv_buffer[size_of_msg];      if ( rb->head.length == 0)	break;      size_of_msg += ntohs(rb->head.length) + 6;      data_size -= ntohs(rb->head.length) + 6;      fc = (unsigned char) *rb->buf;      time_GetTime( &local->connections[l_idx].last_req_time);      exception_code = 0;      switch ( fc) {      case pwr_eModbus_FCEnum_ReadHoldingRegisters: {	io_sCard *cardp;	io_sServerModuleLocal *local_card;	pwr_sClass_Modbus_TCP_ServerModule *mp;	read_req *rmsg = (read_req *)rb;	rsp_read msg;	int found;	short addr = ntohs( rmsg->addr);	short quant = ntohs( rmsg->quant);	unsigned char unit_id = rmsg->head.unit_id;	if ( quant < 1 || quant >= 0x07d0) {	  exception_code = 3;	  break;	}	/* Check the address */	found = 0;	for ( cardp = rp->cardlist; cardp; cardp = cardp->next) {	  mp = (pwr_sClass_Modbus_TCP_ServerModule *) cardp->op;	  if ( mp->UnitId == unit_id) {	    local_card = cardp->Local;	    found = 1;	    break;	  }		}	if ( !found) {	  exception_code = 2;	  break;	}	addr -= mp->ReadAddress;	if ( addr < 0 || 	     addr + quant * 2 > local_card->output_size) {	  exception_code = 2;	  break;	}	msg.fc = fc;	msg.bc = quant * 2;//.........这里部分代码省略.........
开发者ID:Strongc,项目名称:proview,代码行数:101,



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


C++ time_after函数代码示例
C++ timeSetEvent函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。