• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ put_time函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: put_time_info

//-----------------------------------------------------------------------------------
//void put_data_info : hien thi thong tin thu ngay thang tren lcd
//input: gia tri gio phut giay
//output: none
void put_time_info()
{
    lcd_gotoxy(0,0);
    lcd_puts("    ");
    put_time(hour,4,0); 
    lcd_putchar(':');
    put_time(minute,7,0);
    lcd_putchar(':');
    put_time(second,10,0);
    lcd_gotoxy(12,0);
    lcd_puts("    ");
}
开发者ID:Lab411bkhn,项目名称:WSAN_SENSOR,代码行数:16,代码来源:setup_time.c


示例2: Task_2

rtems_task Task_2(
  rtems_task_argument argument
)
{
#if defined(RTEMS_SMP)
  rtems_interrupt_level level;
#endif
  Chain_Control   *ready_queues;

#if (MUST_WAIT_FOR_INTERRUPT == 1)
  while ( Interrupt_occurred == 0 );
#endif
  end_time = benchmark_timer_read();

  put_time(
    "rtems interrupt: entry overhead returns to preempting task",
    Interrupt_enter_time,
    1,
    0,
    timer_overhead
  );

  put_time(
    "rtems interrupt: exit overhead returns to preempting task",
    end_time,
    1,
    0,
    0
  );

  fflush( stdout );

  /*
   *  Switch back to the other task to exit the test.
   */

#if defined(RTEMS_SMP)
  rtems_interrupt_disable(level);
#endif

  ready_queues      = (Chain_Control *) _Scheduler.information;
  _Thread_Executing =
        (Thread_Control *) _Chain_First(&ready_queues[LOW_PRIORITY]);

  _Thread_Dispatch_necessary = 1;

#if defined(RTEMS_SMP)
  rtems_interrupt_enable(level);
#endif

  _Thread_Dispatch();

}
开发者ID:lanzhongheng,项目名称:rtems,代码行数:53,代码来源:task1.c


示例3: Task_2

rtems_task Task_2(
  rtems_task_argument argument
)
{
  Thread_Control *executing = _Thread_Get_executing();
  Scheduler_priority_Context *scheduler_context =
    _Scheduler_priority_Get_context( _Scheduler_Get( executing ) );
  ISR_lock_Context lock_context;

#if (MUST_WAIT_FOR_INTERRUPT == 1)
  while ( Interrupt_occurred == 0 );
#endif
  end_time = benchmark_timer_read();

  put_time(
    "rtems interrupt: entry overhead returns to preempting task",
    Interrupt_enter_time,
    1,
    0,
    timer_overhead
  );

  put_time(
    "rtems interrupt: exit overhead returns to preempting task",
    end_time,
    1,
    0,
    0
  );

  fflush( stdout );

  /*
   *  Switch back to the other task to exit the test.
   */

  _Scheduler_Acquire( executing, &lock_context );

  _Thread_Executing =
        (Thread_Control *) _Chain_First(&scheduler_context->Ready[LOW_PRIORITY]);

  _Thread_Dispatch_necessary = 1;

  _Scheduler_Release( executing, &lock_context );

  _Thread_Dispatch();

}
开发者ID:Avanznow,项目名称:rtems,代码行数:48,代码来源:task1.c


示例4: pthread_rwlock_wrlock

void *Low(
  void *argument
)
{
  int      status;
  benchmark_timer_t end_time;

  /* write locking */
    status = pthread_rwlock_wrlock(&rwlock);
  end_time = benchmark_timer_read();

  rtems_test_assert( status == 0 );

  put_time(
    "pthread_rwlock_unlock: thread waiting preempt",
    end_time,
    OPERATION_COUNT,
    0,
    0
  );

  TEST_END();
  rtems_test_exit( 0 );
  return NULL;
}
开发者ID:Fyleo,项目名称:rtems,代码行数:25,代码来源:init.c


示例5: pthread_mutex_lock

void *Blocker(
  void *argument
)
{

  uint32_t end_time;
  struct   sched_param param;
  int      policy;
  int      status;

  status = pthread_mutex_lock(&MutexID);
  rtems_test_assert( status == 0 );
  status = pthread_getschedparam(pthread_self(), &policy, &param);
  rtems_test_assert( status == 0 );
  param.sched_priority = sched_get_priority_max(policy) - 1;
  status = pthread_setschedparam(pthread_self(), policy, &param);
  /* Thread blocks, unlocks mutex, waits for CondID to be signaled */
  pthread_cond_wait(&CondID,&MutexID);

  /* Once signaled, this thread preempts POSIX_Init thread */
  end_time = benchmark_timer_read();
  put_time(
    "pthread_cond_signal: thread waiting preempt",
    end_time,
    1,
    0,
    0
  );
  TEST_END();
  rtems_test_exit( 0 );
  return NULL;
}
开发者ID:mcspic,项目名称:rtems,代码行数:32,代码来源:init.c


示例6: rtems_time_test_measure_operation

void rtems_time_test_measure_operation(
  const char               *description,
  rtems_time_test_method_t  operation,
  void                     *argument,
  int                       iterations,
  int                       overhead
)
{
  int  i;
  uint32_t loop_overhead;
  uint32_t end_time;

  benchmark_timer_initialize();
    for (i=0 ; i<iterations ; i++ ) {
      benchmark_timer_empty_operation( i, argument );
    }
  loop_overhead = benchmark_timer_read();

  benchmark_timer_initialize();
    for (i=0 ; i<iterations ; i++ ) {
      (*operation)( i, argument );
    }
  end_time = benchmark_timer_read();

  put_time(
    description,
    end_time,
    iterations,
    loop_overhead,
    overhead
  );
}
开发者ID:AlexShiLucky,项目名称:rtems,代码行数:32,代码来源:tmtests_support.c


示例7: High_task

rtems_task High_task(
  rtems_task_argument argument
)
{
  int  index;

  benchmark_timer_initialize();
    for ( index=1 ; index < operation_count ; index++ )
      (void) benchmark_timer_empty_function();
  overhead = benchmark_timer_read();

  benchmark_timer_initialize();
    for ( index=1 ; index <= operation_count ; index++ )
      (void) rtems_message_queue_urgent( Queue_id, Buffer, MESSAGE_SIZE );
  end_time = benchmark_timer_read();

  put_time(
    "rtems_message_queue_urgent: task readied returns to caller",
    end_time,
    operation_count,
    overhead,
    0
  );

  TEST_END();
  rtems_test_exit( 0 );
}
开发者ID:gedare,项目名称:rtems,代码行数:27,代码来源:task1.c


示例8: sched_yield

void *Low(
  void *argument
)
{
  benchmark_timer_t end_time;

  /*
   * Now we have finished the thread startup overhead,
   * so let other threads run.  When we return, we can
   * finish the benchmark.
   */
  sched_yield();
    /* let other threads run */

  end_time = benchmark_timer_read();

  put_time(
    "pthread_exit",
    end_time,
    OPERATION_COUNT,
    0,
    0
  );

  puts( "*** END OF POSIX TIME TEST PSXTMTHREAD03 ***" );
  rtems_test_exit( 0 );
  return NULL;
}
开发者ID:0871087123,项目名称:rtems,代码行数:28,代码来源:init.c


示例9: Task02

rtems_task Task02( rtems_task_argument ignored )
{

  /* Benchmark code */
  benchmark_timer_initialize();
  for ( count = 0; count < BENCHMARKS; count++ ) {
    if ( sem_exe == 1 ) {
      rtems_semaphore_obtain( sem_id, RTEMS_WAIT, 0 );
    }
    rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );

    if ( sem_exe == 1 ) {
      rtems_semaphore_release( sem_id );
    }
    rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
  }
  telapsed = benchmark_timer_read();

  /* Check which run this was */
  if (sem_exe == 0) {
    tswitch_overhead = telapsed;
    rtems_task_suspend( Task_id[0] );
    rtems_task_suspend( RTEMS_SELF );
  } else {
    put_time(
       "Rhealstone: Semaphore Shuffle",
       telapsed,
       (BENCHMARKS * 2),        /* Total number of semaphore-shuffles*/
       tswitch_overhead,        /* Overhead of loop and task switches */
       0
    );
    TEST_END();
    rtems_test_exit( 0 );
  }
}
开发者ID:AlexShiLucky,项目名称:rtems,代码行数:35,代码来源:semshuffle.c


示例10: High_task

rtems_task High_task(
  rtems_task_argument argument
)
{
  int  index;

  benchmark_timer_initialize();
    for ( index=1 ; index < operation_count ; index++ )
      (void) benchmark_timer_empty_function();
  overhead = benchmark_timer_read();

  benchmark_timer_initialize();
    for ( index=1 ; index < operation_count ; index++ )
      (void) rtems_message_queue_send( Queue_id, Buffer, MESSAGE_SIZE );
  end_time = benchmark_timer_read();

  put_time(
    "rtems_message_queue_send: task readied -- returns to caller",
    end_time,
    operation_count - 1,
    overhead,
    CALLING_OVERHEAD_MESSAGE_QUEUE_SEND
  );

  puts( "*** END OF TEST 12 ***" );
  rtems_test_exit( 0 );
}
开发者ID:FullMentalPanic,项目名称:RTEMS_NEW_TOOL_CHAIN,代码行数:27,代码来源:task1.c


示例11: main

int main(void) {
    printf("現在は");
    put_time();
    printf("です。\n");

    return 0;
}
开发者ID:DrakeBrunner,项目名称:scratches,代码行数:7,代码来源:time_struct.c


示例12: sched_yield

void *Low(
  void *argument
)
{
  benchmark_timer_t end_time;

  /*
   * Now we have finished the thread startup overhead,
   * so let other threads run.  When we return, we can
   * finish the benchmark.
   */
  sched_yield();
    /* let other threads run */

  end_time = benchmark_timer_read();

  put_time(
    "pthread_mutex_lock: unavailable block",
    end_time,
    OPERATION_COUNT,
    0,
    0
  );

  TEST_END();

  rtems_test_exit( 0 );
  return NULL;
}
开发者ID:gedare,项目名称:rtems,代码行数:29,代码来源:init.c


示例13: benchmark_mq_timedreceive

static void benchmark_mq_timedreceive(void)
{
  benchmark_timer_t end_time;
  int              status;
  unsigned int     priority;
  struct timespec  timeout;
  int              message[MQ_MAXMSG];

  priority = 1;       /*priority low*/
  timeout.tv_sec  = 0;
  timeout.tv_nsec = 0;
  benchmark_timer_initialize();
    status = mq_timedreceive(
		  queue2, ( char *)message, MQ_MSGSIZE, &priority, &timeout);
  end_time = benchmark_timer_read();
  rtems_test_assert( status != (-1) );

  put_time(
    "mq_timedreceive: available",
    end_time,
    1,        /* Only executed once */
    0,
    0
  );
}
开发者ID:cloud-hot,项目名称:rtems,代码行数:25,代码来源:init.c


示例14: benchmark_pthread_barrier_init

static void benchmark_pthread_barrier_init(void)
{
  benchmark_timer_t end_time;
  int                   status;
  pthread_barrierattr_t attr;

  /* initialize attr with default attributes
   * for all of the attributes defined by the implementation
   */
  status = pthread_barrierattr_init( &attr );
  rtems_test_assert( status == 0 );

  benchmark_timer_initialize();
    status = pthread_barrier_init( &barrier,&attr, 1 );
  end_time = benchmark_timer_read();
  rtems_test_assert( status == 0 );

  put_time(
    "pthread_barrier_init",
    end_time,
    1,        /* Only executed once */
    0,
    0
  );
}
开发者ID:0871087123,项目名称:rtems,代码行数:25,代码来源:init.c


示例15: benchmark_pthread_setschedparam

void benchmark_pthread_setschedparam(void)
{
  uint32_t            end_time;
  int                 status;
  int                 policy;
  struct sched_param  param;

  status = pthread_getschedparam( pthread_self(), &policy, &param );
  rtems_test_assert( status == 0 );
  
  /* Arbitrary priority, no other threads to preempt us so it doesn't matter. */
  param.sched_priority = 5;
  benchmark_timer_initialize();
  status = pthread_setschedparam( pthread_self(), policy, &param );
  end_time = benchmark_timer_read();
  rtems_test_assert( status == 0 );

  put_time(
     "pthread_setschedparam: no thread switch",
     end_time,
     1,       /* Only executed once */
     0,
     0
  ); 
}
开发者ID:AlexShiLucky,项目名称:rtems,代码行数:25,代码来源:init.c


示例16: put_date_info

//-----------------------------------------------------------------------------------
//void put_data_info : hien thi thong tin thu ngay thang tren lcd
//input: none
//output: none
void put_date_info()
{
    lcd_gotoxy(0,1);
    lcd_puts(" ");  
    switch(day)
    { 
        // neu la chu nhat 
        case 1:
            lcd_puts("CN ");
         break;
        // neu la thu 2 
        case 2:
            lcd_puts("T2 ");
        break;
        //neu la thu 3
        case 3:
        lcd_puts("T3 ");
        break; 
        // neu la thu 4
        case 4:
        lcd_puts("T4 ");
        break; 
        // neu la thu 5
        case 5:
        lcd_puts("T5 ");
        break; 
        // neu la thu 6
        case 6:
        lcd_puts("T6 ");
        break; 
        // neu la thu 7
        case 7:
        lcd_puts("T7 ");
        break; 
        // neu khong co truong hop nao thi out
        default: 
        break;
    }
    put_time(date,4,1);
    lcd_putchar('-');
    put_time(month,7,1);
    lcd_putchar('-');
    lcd_gotoxy(10,1);   
    lcd_puts("20    "); 
    put_time(year,12,1);
}
开发者ID:Lab411bkhn,项目名称:WSAN_SENSOR,代码行数:50,代码来源:setup_time.c


示例17: timestampToLocalString

 std::string timestampToLocalString(const Timepoint& timestamp)
 {
     const time_t time = std::chrono::system_clock::to_time_t(timestamp);
     std::stringstream ss;
     struct tm ptime;
     localtime_r(&time, &ptime);
     ss << put_time(&ptime, "%Y-%m-%dT%H:%M:%S");
     return ss.str();
 }
开发者ID:bbannier,项目名称:csvsqldb,代码行数:9,代码来源:time_helper.cpp


示例18: TEST_BEGIN

void *POSIX_Init(
  void *argument
)
{
  int                   status;
  pthread_t             threadId;
  benchmark_timer_t end_time;
  pthread_rwlockattr_t  attr;

  TEST_BEGIN();

  status = pthread_create( &threadId, NULL, Blocker, NULL );
  rtems_test_assert( status == 0 );
  /*
   * Deliberately create the rwlock after the threads.  This way if the
   * threads do run before we intend, they will get an error.
   */

  /* creating rwlock */
    status = pthread_rwlockattr_init( &attr );
  rtems_test_assert( status == 0 );
  status = pthread_rwlock_init( &rwlock, &attr );
  rtems_test_assert( status == 0 );

  /*
   * Ensure the rwlock is unavailable so the other threads block.
   */
  /* lock rwlock to ensure thread blocks */
  status = pthread_rwlock_wrlock(&rwlock);
  rtems_test_assert( status == 0 );

  /*
   * Let the other thread start so the thread startup overhead,
   * is accounted for.  When we return, we can start the benchmark.
   */
  sched_yield();
    /* let other thread run */

  benchmark_timer_initialize();
    status = pthread_rwlock_unlock(&rwlock); /*  unlock the rwlock */
  end_time = benchmark_timer_read();
  rtems_test_assert( status == 0 );

  put_time(
    "pthread_rwlock_unlock: thread waiting no preempt",
    end_time,
    1,
    0,
    0
  );

  TEST_END();
  rtems_test_exit( 0 );

  return NULL;
}
开发者ID:Fyleo,项目名称:rtems,代码行数:56,代码来源:init.c


示例19: TEST_BEGIN

void *POSIX_Init(
  void *argument
)
{
  int        status;
  pthread_t  threadId;
  uint32_t   end_time;
  struct sched_param param;
  int policy;

  TEST_BEGIN();

  status = pthread_create( &threadId, NULL, Blocker, NULL );
  rtems_test_assert( status == 0 );
  
  status = pthread_mutex_init(&MutexID, NULL);
  rtems_test_assert( status == 0 );

  status = pthread_cond_init(&CondID, NULL); /* Create condition variable */
  rtems_test_assert( status == 0 );

  /*
   * Let the other thread start so the thread startup overhead,
   * is accounted for.  When we return, we can start the benchmark.
   */
  sched_yield();
    /* let other thread run */

  /* To be extra sure we don't get preempted on the signal */
  status = pthread_getschedparam(pthread_self(), &policy, &param);
  rtems_test_assert( status == 0);
  param.sched_priority = sched_get_priority_max(policy) - 1;
  status = pthread_setschedparam(pthread_self(), policy, &param);
  rtems_test_assert( status == 0);

  benchmark_timer_initialize();
  status = pthread_cond_signal(&CondID);
  end_time = benchmark_timer_read();
  rtems_test_assert( status == 0 );

  put_time(
    "pthread_cond_signal: thread waiting no preempt",
    end_time,
    1,
    0,
    0
  );

  TEST_END();
  rtems_test_exit( 0 );

  return NULL;
}
开发者ID:AlexShiLucky,项目名称:rtems,代码行数:53,代码来源:init.c


示例20: Task_2

rtems_task Task_2(
  rtems_task_argument argument
)
{
#if (MUST_WAIT_FOR_INTERRUPT == 1)
  while ( Interrupt_occurred == 0 );
#endif
  end_time = Timer_read();

  put_time(
    "interrupt entry overhead: returns to preempting task",
    Interrupt_enter_time,
    1,
    0,
    timer_overhead
  );

  put_time(
    "interrupt exit overhead: returns to preempting task",
    end_time,
    1,
    0,
    0
  );

  fflush( stdout );

  /*
   *  Switch back to the other task to exit the test.
   */

  _Thread_Dispatch_disable_level = 0;

  _Thread_Heir = (rtems_tcb *) _Thread_Ready_chain[254].first;

  _Context_Switch_necessary = 1;

  _Thread_Dispatch();

}
开发者ID:jfpmonteiro,项目名称:rtems-4.8-rhealstone,代码行数:40,代码来源:task1.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ put_tty_driver函数代码示例发布时间:2022-05-30
下一篇:
C++ put_task_struct函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap