当前位置: 首页>>代码示例>>C++>>正文


C++ put_time函数代码示例

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


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


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