这篇教程C++ timerStart函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中timerStart函数的典型用法代码示例。如果您正苦于以下问题:C++ timerStart函数的具体用法?C++ timerStart怎么用?C++ timerStart使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了timerStart函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: issueDelayReqTimerExpiredstatic void issueDelayReqTimerExpired(PtpClock *ptpClock){ switch (ptpClock->portDS.delayMechanism) { case E2E: if(ptpClock->portDS.portState != PTP_SLAVE) { break; } if (timerExpired(DELAYREQ_INTERVAL_TIMER, ptpClock->itimer)) { timerStart(DELAYREQ_INTERVAL_TIMER, getRand(pow2ms(ptpClock->portDS.logMinDelayReqInterval + 1)), ptpClock->itimer); DBGV("event DELAYREQ_INTERVAL_TIMEOUT_EXPIRES/n"); issueDelayReq(ptpClock); } break; case P2P: if (timerExpired(PDELAYREQ_INTERVAL_TIMER, ptpClock->itimer)) { timerStart(PDELAYREQ_INTERVAL_TIMER, getRand(pow2ms(ptpClock->portDS.logMinPdelayReqInterval + 1)), ptpClock->itimer); DBGV("event PDELAYREQ_INTERVAL_TIMEOUT_EXPIRES/n"); issuePDelayReq(ptpClock); } break; default: break; }}
开发者ID:korrav,项目名称:emmiter_slave,代码行数:33,
示例2: MB_byte_received_cbvoid MB_byte_received_cb(uint8_t chr){ //printf("%x ", chr); if (txState != TX_STATE_IDLE) { return; } switch(rxState) { case RX_STATE_INIT : //Wait 3.5 chars, required for ModBus initialization timerStart((uint16_t)(7 * tChar / 2), MB_t35Expired_cb); break; case RX_STATE_IDLE : //First byte of Serial PDU received mbBufferPosition = 0; mbBuffer[mbBufferPosition++] = chr; rxState = RX_STATE_RCV; timerStart((uint16_t)(3 * tChar / 2), MB_t15Expired_cb); break; case RX_STATE_RCV : //Next byte of Serial PDU received if (mbBufferPosition < MB_SIZE_MAX + 1) { mbBuffer[mbBufferPosition++] = chr; //Save byte to buffer } else { //Buffer overflow occurred mbEvent = MB_EVENT_ERROR; rxState = RX_STATE_INIT; } timerStart((uint16_t)(3 * tChar / 2), MB_t15Expired_cb); break; case RX_STATE_T35EXPECTED : //t15 interval passed from last byte, but t35 not mbEvent = MB_EVENT_ERROR; rxState = RX_STATE_INIT; break; }}
开发者ID:Lexatagan,项目名称:modbus,代码行数:32,
示例3: mainint main() { // Example 1 [-1,1] a = -1.0; b = 1.0; n = 1000; int curr_num_threads[3] = {2, 50, 100}; for (int i=0; i<3; i++) { approx = 0; thread_count = curr_num_threads[i]; printf("/nRun with %d threads/n", thread_count); timerStart(); run_threads(); printf("Took %ld ms/n", timerStop()); printf("a:%f/t b:%f/t n:%d/t actual:%f/t approximation:%f/n", a, b, n, NEG_1_TO_POS_1, approx); } // Example 2 [0,10] a = 0.0; b = 10.0; n = 1000; for (int i=0; i<3; i++) { approx = 0; thread_count = curr_num_threads[i]; printf("/nRun with %d threads/n", thread_count); timerStart(); run_threads(); printf("Took %ld ms/n", timerStop()); printf("a:%f/t b:%f/t n:%d/t actual:%f/t approximation:%f/n", a, b, n, ZERO_TO_POS_10, approx); } return 0;}
开发者ID:mvbp,项目名称:High-Performance-Computing-Projects,代码行数:34,
示例4: trainIterationAvoid trainIterationA(svd_entry * users, svd_entry * movies, float l, data_entry* trainset, float* temporary, int trainsize){ float t,h = 0; svd_entry *u, *m; data_entry *tt; timerStart(1); for (int i = 0; i < trainsize; i++) { tt = &trainset[i]; temporary[i] = l*(tt->rating - predict(users, movies, tt->user_ptr, tt->movie_ptr)); } printf("---errors:%.3f/n", timerGetS(1)); for (int i = 0; i < SVD_dim; i++) { timerStart(1); for (int j = 0; j < trainsize; j++) { u = &users[trainset[j].user_ptr]; m = &movies[trainset[j].movie_ptr]; h = u->params[i]; t = temporary[j]; u->params[i] += t*m->params[i]; m->params[i] += t*h; } }}
开发者ID:Stephaninos,项目名称:CS-156b,代码行数:26,
示例5: onOffDelayUpdatebool onOffDelayUpdate(OnOffDelay* me, bool Trg) { switch (me->state) { case S0: if (Trg) { me->state = S1; timerStart(me->timer, me->TH); } break; case S1: if (Trg) { if (timerExpired(me->timer)) { me->state = S2; } } else { me->state = S0; } break; case S2: if (!Trg) { me->state = S3; timerStart(me->timer, me->TL); } break; case S3: if (!Trg) { if (timerExpired(me->timer)) { me->state = S0; } } else { me->state = S0; } break; } return onOffDelayOutput(me);}
开发者ID:carloamaglio,项目名称:mod-io2-alone,代码行数:35,
示例6: videoVBLbool videoVBL(){ if(!videoPlaying) return false; while(videoFrames == 0) swiWaitForVBlank(); videoFrames--; printf("/x1b[13;1HOVERHEAD: %d ", videoFrames); timerStart(0, ClockDivider_1024, 0, NULL); bool ok = videoReadFrame(); int dd = timerElapsed(0)/ (BUS_CLOCK / 100 / 60 / 1024); printf("/x1b[11;1HREAD TIME: %d %% ", dd); timerStop(0); if(!ok) return false; timerStart(0, ClockDivider_1024, 0, NULL); videoDecodeFrame(); dd = timerElapsed(0)/ (BUS_CLOCK / 100 / 60 / 1024); printf("/x1b[12;1HDISP TIME: %d %% ", dd); timerStop(0); printf("/x1b[14;1HFRAME SIZE: %d ", videoFrameLen); return true;}
开发者ID:xfix,项目名称:Fireworlds,代码行数:25,
示例7: main// Main methodint main(int argc, char* argv[]) { int N; double elapsedTime; // checking parameters if (argc != 2 && argc != 4) { printf("Parameters: <N> [<fileA> <fileB>]/n"); return 1; } N = atoi(argv[1]); initMatrixes(N); // reading files (optional) if(argc == 4){ readMatrixFile(A,N,argv[2]); readMatrixFile(B,N,argv[3]); } else { // Otherwise, generate two random matrix. for (int i=0; i<N; i++) { for (int j=0; j<N; j++) { A[i][j] = rand() % 5; B[i][j] = rand() % 5; } } } // Do simple multiplication and time it. timerStart(); simpleMM(N); printf("Simple MM took %ld ms/n", timerStop()); // Do strassen multiplication and time it. timerStart(); strassenMM(N); printf("Strassen MM took %ld ms/n", timerStop()); if (compareMatrix(C, R, N) != 0) { if (N < 20) { printf("/n/n------- MATRIX C/n"); printMatrix(C,N); printf("/n------- MATRIX R/n"); printMatrix(R,N); } printf("Matrix C doesn't match Matrix R, if N < 20 they will be printed above./n"); } // stopping timer cleanup(); return 0;}
开发者ID:chuckie512,项目名称:hpc-course,代码行数:52,
示例8: timerStart/** * @details * Runs the pipeline. * * This method is run repeatedly by the pipeline application every time * data matching the requested remote data is available until either * the pipeline application is killed or the method 'stop()' is called. */void UdpBFPipeline::run(QHash<QString, DataBlob*>& remoteData){ timerStart(&_totalTime); // Get pointer to the remote time series data blob. // This is a block of data containing a number of time series of length // N for each sub-band and polarisation. timeSeries = (TimeSeriesDataSetC32*) remoteData[_streamIdentifier]; dataOutput( timeSeries, _streamIdentifier); // Run the polyphase channeliser. // Generates spectra from a blocks of time series indexed by sub-band // and polarisation. ppfChanneliser->run(timeSeries, spectra); // Convert spectra in X, Y polarisation into spectra with stokes parameters. stokesGenerator->run(spectra, stokes); // Clips RFI and modifies blob in place weightedIntStokes->reset(stokes); timerStart(&_rfiClipperTime); rfiClipper->run(weightedIntStokes); timerUpdate(&_rfiClipperTime); dataOutput(&(weightedIntStokes->stats()), "RFI_Stats"); stokesIntegrator->run(stokes, intStokes); // Calls output stream managed->send(data, stream) the output stream // manager is configured in the xml. dataOutput(intStokes, "SpectrumDataSetStokes");// stop(); if (_iteration % 100 == 0) cout << "Finished the CV beamforming pipeline, iteration " << _iteration << " out of " << _totalIterations << endl; _iteration++; if (_iteration == _totalIterations) stop(); #ifdef TIMING_ENABLED timerUpdate(&_totalTime); if( _iteration % 100 == 0 ) { timerReport(&_rfiClipperTime, "RFI_Clipper"); timerReport(&_totalTime, "Pipeline Time (excluding adapter)"); std::cout << std::endl; }#endif}
开发者ID:chrisjwilliams,项目名称:pelican-katburst,代码行数:58,
示例9: memsetvoid SoundEngine::initStreaming(int timerChannel){ memset(buffer, 0, sizeof buffer); bufferIndex = 0; /* * Next timer tick will populate the first half of the buffer * (bufferIndex=0) but by the time we get there, the audio * hardware will already be started on the second half. We want * the sound hardware and Timer 0 to stay synchronized, so that * they're always operating on opposite halves of 'buffer'. */ timerStart(timerChannel, ClockDivider_256, timerFreqToTicks_256(SAMPLE_RATE / SAMPLES_PER_FRAME), timerCallback); /* * Start playing a circular sound buffer that holds 2 frames. */ SCHANNEL_SOURCE(CHANNEL_PCSPEAKER) = (uint32_t) &buffer[0]; SCHANNEL_REPEAT_POINT(CHANNEL_PCSPEAKER) = 0; SCHANNEL_LENGTH(CHANNEL_PCSPEAKER) = BUFFER_SIZE / sizeof(uint32_t); SCHANNEL_TIMER(CHANNEL_PCSPEAKER) = SOUND_FREQ(SAMPLE_RATE); SCHANNEL_CR(CHANNEL_PCSPEAKER) = SCHANNEL_ENABLE | SOUND_VOL(127) | SOUND_PAN(64) | SOUND_REPEAT | SOUND_FORMAT_8BIT;}
开发者ID:B-Rich,项目名称:robot-odyssey-ds,代码行数:30,
示例10: testTimervoid testTimer(void){ unsigned int count = 0; signed int ms = 0; signed int ss = 0; timerClearCount(HW_TIMER2); timerBegin(__CLK__FREQUENCY,__GSM_MODEM_TIMEOUT_US,HW_TIMER2); timerEnableInterrupt(HW_TIMER2); timerStart(HW_TIMER2); while(1) { if(timerCount2 >= 1000) { timerCount2 = 0; ms++; /* if(ms == 1000) { ms = 0; ss++; SerialIntWrite(ss,10); Serialwrite(LF); }*/ SerialIntWrite(ms,10); Serialwrite(LF); } }}
开发者ID:sriharshaq,项目名称:DTMF-Bot,代码行数:27,
示例11: realTimeInit/*** /fn U8 realTimeInit(U32 tickPeriod)* @brief Initialised the Real-Time system to a specified sysTick period* @note Intensive Computation, used only at init time.* Keep the value between 100 and 64 535 000 to be accurate and useful* Use the Hardware Timer 1* Use a dividable number by 1000 to assure precision of the software rtcc* @arg U32 tickPeriod Desired period of a sysTick (in C++ timer_Stop函数代码示例 C++ timerEvent函数代码示例
|