本文整理汇总了C++中TIMER_STOP函数的典型用法代码示例。如果您正苦于以下问题:C++ TIMER_STOP函数的具体用法?C++ TIMER_STOP怎么用?C++ TIMER_STOP使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TIMER_STOP函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TIMER_START
void EdgeBasedGraphFactory::Run(const std::string &original_edge_data_filename,
const std::string &geometry_filename,
lua_State *lua_state)
{
TIMER_START(geometry);
CompressGeometry();
TIMER_STOP(geometry);
TIMER_START(renumber);
RenumberEdges();
TIMER_STOP(renumber);
TIMER_START(generate_nodes);
GenerateEdgeExpandedNodes();
TIMER_STOP(generate_nodes);
TIMER_START(generate_edges);
GenerateEdgeExpandedEdges(original_edge_data_filename, lua_state);
TIMER_STOP(generate_edges);
m_geometry_compressor.SerializeInternalVector(geometry_filename);
SimpleLogger().Write() << "Timing statistics for edge-expanded graph:";
SimpleLogger().Write() << "Geometry compression: " << TIMER_SEC(geometry) << "s";
SimpleLogger().Write() << "Renumbering edges: " << TIMER_SEC(renumber) << "s";
SimpleLogger().Write() << "Generating nodes: " << TIMER_SEC(generate_nodes) << "s";
SimpleLogger().Write() << "Generating edges: " << TIMER_SEC(generate_edges) << "s";
}
示例2: TIMER_START
double ProblemDescription::evaluateConstraint( const double * xi,
double * h,
double * H )
{
if ( factory.empty() ) {return 0; }
TIMER_START( "constraint" );
assert( h ); // make sure that h is not NULL
prepareData( xi );
MatMap h_map( h, factory.numOutput(), 1 );
if ( !H ){
const double val = factory.evaluate( trajectory, h_map );
TIMER_STOP( "constraint" );
return val;
}
MatMap H_map( H, trajectory.size(), factory.numOutput() );
double magnitude = factory.evaluate(trajectory, h_map, H_map );
if( doing_covariant ){
//TODO find out if this is correct
MatMap H_map2( H, trajectory.N(),
trajectory.M()*factory.numOutput() );
metric.multiplyLowerInverse( H_map2 );
}
TIMER_STOP( "constraint" );
return magnitude;
}
示例3: Delayms
void Delayms (uint32_t ms)
{
TIMER_STOP();
TIMER_START(ms * 1000);
while (!TIMER_EXPIRED());
TIMER_STOP();
}
示例4: irkit_http_loop
void irkit_http_loop() {
#ifdef USE_INTERNET
// long poll
if (TIMER_FIRED(polling_timer)) {
TIMER_STOP(polling_timer);
if (TIMER_RUNNING(suspend_polling_timer)) {
// suspend GET /m for a while if we have received a POST /messages request from client
// client is in wifi, we can ignore our server for a while
TIMER_START(polling_timer, SUSPEND_GET_MESSAGES_INTERVAL);
}
else {
int8_t result = irkit_httpclient_get_messages();
if ( result < 0 ) {
HTTPLOG_PRINTLN("!E3");
// maybe time cures GS? (no it doesn't, let's hardware reset, software reset doesn't work here)
// don't software reset AVR, because that cuts off serial logging (for debug purpose only)
wifi_hardware_reset();
}
else {
polling_cid = result;
}
}
}
if (TIMER_FIRED(suspend_polling_timer)) {
TIMER_STOP(suspend_polling_timer);
}
#endif
}
示例5: while
uint8_t GSwifi::checkActivity() {
static uint8_t continuous_timeouts_ = 0;
while ( serial_->available() &&
! TIMER_FIRED(timeout_timer_) ) {
parseByte( serial_->read() );
if ( gs_failure_ ||
(gs_ok_ &&
(gs_response_lines_ == RESPONSE_LINES_ENDED ||
gs_commandmode_ == GSCOMMANDMODE_NONE)) ) {
gs_commandmode_ = GSCOMMANDMODE_NONE;
continuous_timeouts_ = 0;
setBusy(false);
break;
}
}
if ( busy_ &&
TIMER_FIRED(timeout_timer_) ) {
TIMER_STOP(timeout_timer_);
GSLOG_PRINTLN("!E24");
did_timeout_ = true;
continuous_timeouts_ ++;
setBusy(false);
}
// need a GS hardware reset, which we issue in setup()
ASSERT( continuous_timeouts_ <= 5 );
return busy_;
}
示例6: test_sbit_cache
int
test_sbit_cache( btimer_t* timer,
FT_Face face,
void* user_data )
{
FTC_SBit glyph;
int i, done = 0;
FT_UNUSED( user_data );
if ( !sbit_cache )
{
if ( FTC_SBitCache_New(cache_man, &sbit_cache) )
return 0;
}
TIMER_START( timer );
for ( i = 0; i < face->num_glyphs; i++ )
{
if ( !FTC_SBitCache_Lookup(sbit_cache, &font_type, i, &glyph, NULL) )
done++;
}
TIMER_STOP( timer );
return done;
}
示例7: TIMER_START
/**
* Tests inserting blob data as a stream
*
* @throws Exception
* if an error occurs
*/
void BlobTest::testBlobInsert( Connection & c, bool asString )
{
TIMER_START( "Populating blob table" );
pstmt.reset( conn->prepareStatement("INSERT INTO BLOBTEST(blobdata) VALUES (?)") );
if ( asString )
{
sql::SQLString str;
testBlobFile->readFile( const_cast<std::string&>(str.asStdString()) );
pstmt->setString( 1, str );
pstmt->execute();
}
else
{
std::fstream & bIn= testBlobFile->getStream();
ASSERT( ! bIn.fail() );
pstmt->setBlob( 1, & bIn );
pstmt->execute();
}
TIMER_STOP("Populating blob table");
pstmt->clearParameters();
doRetrieval();
}
示例8: TIMER_START
/* save screenshot in bmp format, return true if success, or false */
bool CScreenShot::SaveBmp()
{
TIMER_START();
if(!OpenFile())
return false;
unsigned char hdr[14 + 40];
unsigned int i = 0;
#define PUT32(x) hdr[i++] = ((x)&0xFF); hdr[i++] = (((x)>>8)&0xFF); hdr[i++] = (((x)>>16)&0xFF); hdr[i++] = (((x)>>24)&0xFF);
#define PUT16(x) hdr[i++] = ((x)&0xFF); hdr[i++] = (((x)>>8)&0xFF);
#define PUT8(x) hdr[i++] = ((x)&0xFF);
PUT8('B'); PUT8('M');
PUT32((((xres * yres) * 3 + 3) &~ 3) + 14 + 40);
PUT16(0); PUT16(0); PUT32(14 + 40);
PUT32(40); PUT32(xres); PUT32(yres);
PUT16(1);
PUT16(4*8); // bits
PUT32(0); PUT32(0); PUT32(0); PUT32(0); PUT32(0); PUT32(0);
#undef PUT32
#undef PUT16
#undef PUT8
fwrite(hdr, 1, i, fd);
int y;
for (y=yres-1; y>=0 ; y-=1) {
fwrite(pixel_data+(y*xres*4),xres*4,1,fd);
}
fclose(fd);
TIMER_STOP(filename.c_str());
return true;
}
示例9: TIMER_START
void CFrontend::sendDiseqcCommand(const struct dvb_diseqc_master_cmd *cmd, const uint32_t ms)
{
TIMER_START();
#if HAVE_DVB_API_VERSION >= 3
if (fop(ioctl, FE_DISEQC_SEND_MASTER_CMD, cmd) == 0)
#else
secCmdSequence sequence;
secCommand command;
sequence.miniCommand = SEC_MINI_NONE;
sequence.continuousTone = currentToneMode;
sequence.voltage = currentTransponder.polarization;
command.type = SEC_CMDTYPE_DISEQC_RAW;
command.u.diseqc.cmdtype = cmd->msg[0];
command.u.diseqc.addr = cmd->msg[1];
command.u.diseqc.cmd = cmd->msg[2];
command.u.diseqc.numParams = cmd->msg_len - 3;
for (int i=0; i < (cmd->msg_len - 3); i++)
command.u.diseqc.params[i] = cmd->msg[3 + i];
sequence.commands = &command;
sequence.numCommands = 1;
if (fop_sec(ioctl, SEC_SEND_SEQUENCE, sequence) == 0)
#endif
usleep(1000 * ms);
TIMER_STOP();
}
示例10: IR_state
void IR_state (uint8_t nextState)
{
switch (nextState) {
case IR_IDLE:
IR_TX_OFF();
IR_COMPARE_DISABLE();
// 1st interrupt when receiving ir must be falling edge
IR_CAPTURE_FALL();
IR_CAPTURE_ENABLE();
IR_clear();
break;
case IR_RECVING:
IR_clear();
TIMER_START( IrCtrl.recv_timer, RECV_TIMEOUT );
break;
case IR_RECVED:
TIMER_STOP( IrCtrl.recv_timer );
irpacker_packend( &packer_state );
// disable til IRKit.cpp reports IR data to server
IR_CAPTURE_DISABLE();
IR_COMPARE_DISABLE();
if (IrCtrl.len < VALID_IR_LEN_MIN) {
// received, but probably noise
IR_state( IR_IDLE );
return;
}
break;
case IR_RECVED_IDLE:
// holds received IR data, and ready to receive next
IR_CAPTURE_FALL();
IR_CAPTURE_ENABLE();
break;
case IR_READING:
irpacker_unpack_start( &packer_state );
IR_CAPTURE_DISABLE();
IR_COMPARE_DISABLE();
break;
case IR_WRITING:
IR_CAPTURE_DISABLE();
IR_COMPARE_DISABLE();
IR_clear();
break;
case IR_XMITTING:
IR_CAPTURE_DISABLE();
IR_COMPARE_DISABLE();
IrCtrl.tx_index = 0;
TIMER_START( IrCtrl.xmit_timer, XMIT_TIMEOUT );
break;
case IR_DISABLED:
IR_CAPTURE_DISABLE();
IR_COMPARE_DISABLE();
break;
}
IrCtrl.state = nextState;
}
示例11: test_get_cbox
int
test_get_cbox( btimer_t* timer,
FT_Face face,
void* user_data )
{
FT_Glyph glyph;
FT_BBox bbox;
int i, done = 0;
FT_UNUSED( user_data );
for ( i = 0; i < face->num_glyphs; i++ )
{
if ( FT_Load_Glyph( face, i, load_flags ) )
continue;
if ( FT_Get_Glyph( face->glyph, &glyph ) )
continue;
TIMER_START( timer );
FT_Glyph_Get_CBox( glyph, FT_GLYPH_BBOX_PIXELS, &bbox );
TIMER_STOP( timer );
FT_Done_Glyph( glyph );
done++;
}
return done;
}
示例12: generate_level
void generate_level(Level *lvl, char *id) {
LevelGeneratorFunc func = NULL;
unsigned i;
clock_t t;
/* If 'id' is null, go with the default: */
if(!id) id = GENERATOR_LIST[0].id;
/* Look for the id: */
for(i=0; GENERATOR_LIST[i].id; i++) {
if(!strcmp(id, GENERATOR_LIST[i].id)) {
gamelib_print("Using level generator: '%s'\n", GENERATOR_LIST[i].id);
func = GENERATOR_LIST[i].gen;
goto generate_level;
}
}
/* Report what level generator we found: */
gamelib_print("Couldn't find level generator: '%s'\n", id);
gamelib_print("Using default level generator: '%s'\n", GENERATOR_LIST[0].id);
/* If we didn't find the id, then we select the default: */
if(!func) func = GENERATOR_LIST[0].gen;
generate_level:
TIMER_START(t);
/* Ok, now generate the level: */
func(lvl);
gamelib_print("Level generated in: ");
TIMER_STOP(t);
}
示例13: test_cmap_cache
int
test_cmap_cache( btimer_t* timer,
FT_Face face,
void* user_data )
{
bcharset_t* charset = (bcharset_t*)user_data;
int i, done = 0;
FT_UNUSED( face );
if ( !cmap_cache )
{
if ( FTC_CMapCache_New(cache_man, &cmap_cache) )
return 0;
}
TIMER_START( timer );
for ( i = 0; i < charset->size; i++ )
{
if ( FTC_CMapCache_Lookup( cmap_cache, font_type.face_id, 0, charset->code[i] ) )
done++;
}
TIMER_STOP( timer );
return done;
}
示例14: test_get_glyph
int
test_get_glyph( btimer_t* timer,
FT_Face face,
void* user_data )
{
FT_Glyph glyph;
int i, done = 0;
FT_UNUSED( user_data );
for ( i = 0; i < face->num_glyphs; i++ )
{
if ( FT_Load_Glyph( face, i, load_flags ) )
continue;
TIMER_START( timer );
if ( !FT_Get_Glyph( face->glyph, &glyph ) )
{
FT_Done_Glyph( glyph );
done++;
}
TIMER_STOP( timer );
}
return done;
}
示例15: main
int main(int argc, char** argv){
int n;
if (argc > 1)
n = atoi(argv[1]);
else
n = 40;
if (cilk_io_init()) {
fprintf(stderr,"cilk_io_init failed\n");
exit(1);
}
int socketID;
long j;
int i;
int arr[NUM_SERVERS];
int* sockIDs = initReduce();
my_timer_t t;
TIMER_START(t);
// Currently it only works if cilk_read/writes are within a cilk_spawn
cilk_spawn distPfib(n, sockIDs, &j);
TIMER_STOP(t);
printf("computed distFib of %d\treturned: %lu\ttime: %4f\n", n, j, TIMER_EVAL(t));
return 0;
}