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


C++ display_time函数代码示例

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


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

示例1: main

int main(void)
{
    Ttime j;
    Ttime time[M];
    Ttime dur;
    Ttime smal;
    int i = 0;

    printf("How many times you have? ");
    scanf("%d", &j);

    for(i = 0; i<j; i++) {
        printf("Give the time %d (hh mm)? ", i+1);
        read_time(&time[i]);
    }

    smal = smallest(time, j);
    //printf("%d" , smal);
    //display_time(&smal);
    printf("Result list:\n");
    for(i = 0; i<j; i++) {
        time_diff(&smal, &time[i], &dur);
        display_time(&time[i]);
        printf(" ");
        display_time(&dur);
        printf("\n");
    }

    return 0;
}
开发者ID:msisov,项目名称:DatastructuresAndAlgorithms,代码行数:30,代码来源:process_times.c

示例2: main

int main(void)
{
	fd_set readfds;
	struct timeval timeout;
	int ret;
	FD_ZERO(&readfds);
	FD_SET(0,&readfds);

	while(1)
	{	
		timeout.tv_sec=10;
		timeout.tv_usec=0;

		display_time("before select");
		ret=select(1,&readfds,NULL,NULL,&timeout);
		display_time("after select");
		switch(ret)
		{
			case 0:printf("there are no data!\n");
				   exit(1);
				   break;
			case -1:perror("select");
					exit(1);
					break;
			default:getchar();
					printf("Data is available now.\n");

		}
	}
	return 0;
}
开发者ID:chendi1995,项目名称:linux_c,代码行数:31,代码来源:11-2.c

示例3: main

int main( void )
{
    fd_set  readfds;
    struct timeval timeout;
    int     ret;

    //监视文件描述符0是否有输入,文件描述符0表示输入,即键盘输入
    FD_ZERO( &readfds );
    FD_SET( 0 , &readfds );

    //设置阻塞时间为10秒
    timeout.tv_sec = 10 ;
    timeout.tv_usec = 0 ;

    while( 1 ){
        display_time("before select");
        ret = select( 1 , &readfds , NULL , NULL , &timeout );
        display_time("after select");

        switch( ret ){
            case 0 :
                printf("No data in ten seconds.\n");
                exit( 0 );
                break;
            case -1 :
                perror( "select" );
                break;
            default:
                getchar();
                printf("Data is avaliable now.\n");
        }
    }
    return 0;
}
开发者ID:murongyimo,项目名称:learnGit,代码行数:34,代码来源:test_select.c

示例4: display_domain_info

static void display_domain_info(struct netr_DELTA_DOMAIN *r)
{
	time_t u_logout;
	struct netr_AcctLockStr *lockstr = NULL;
	NTSTATUS status;
	TALLOC_CTX *mem_ctx = talloc_tos();

	status = pull_netr_AcctLockStr(mem_ctx, &r->account_lockout,
				       &lockstr);
	if (!NT_STATUS_IS_OK(status)) {
		d_printf("failed to pull account lockout string: %s\n",
			nt_errstr(status));
	}

	u_logout = uint64s_nt_time_to_unix_abs((const uint64 *)&r->force_logoff_time);

	d_printf("Domain name: %s\n", r->domain_name.string);

	d_printf("Minimal Password Length: %d\n", r->min_password_length);
	d_printf("Password History Length: %d\n", r->password_history_length);

	d_printf("Force Logoff: %d\n", (int)u_logout);

	d_printf("Max Password Age: %s\n", display_time(r->max_password_age));
	d_printf("Min Password Age: %s\n", display_time(r->min_password_age));

	if (lockstr) {
		d_printf("Lockout Time: %s\n", display_time((NTTIME)lockstr->lockout_duration));
		d_printf("Lockout Reset Time: %s\n", display_time((NTTIME)lockstr->reset_count));
		d_printf("Bad Attempt Lockout: %d\n", lockstr->bad_attempt_lockout);
	}

	d_printf("User must logon to change password: %d\n", r->logon_to_chgpass);
}
开发者ID:0x24bin,项目名称:winexe-1,代码行数:34,代码来源:libnet_samsync_display.c

示例5: display_sam_unk_info_1

static void display_sam_unk_info_1(SAM_UNK_INFO_1 *info1)
{
	
	printf("Minimum password length:                     %d\n", info1->min_length_password);
	printf("Password uniqueness (remember x passwords):  %d\n", info1->password_history);
	printf("flag:                                        ");
	if(info1->flag&&2==2) printf("users must open a session to change password ");
	printf("\n");

	printf("password expire in:                          %s\n", display_time(info1->expire));
	printf("Min password age (allow changing in x days): %s\n", display_time(info1->min_passwordage));
}
开发者ID:jophxy,项目名称:samba,代码行数:12,代码来源:cmd_samr.c

示例6: loop

void loop()
{
	while (1)
	{
		reset_screens();

		display_time(&time1);
		display_time(&time2);
		display_time(&time3);
		display_time(&time4);

		update_clock(&cclock);
		sleep(60);
	}
}
开发者ID:L3n-M3n,项目名称:SchoolCode,代码行数:15,代码来源:nintendo_ds.cpp

示例7: main_window_load

static void main_window_load(Window *window) {
  time_t now = time(NULL);
  struct tm *tick_time = localtime(&now);
  display_time(tick_time);

  tick_timer_service_subscribe(MINUTE_UNIT, handle_minute_tick);
}
开发者ID:DamiMartinez,项目名称:pebble-sdk-examples,代码行数:7,代码来源:big_time.c

示例8: RTC_IRQHandler

void RTC_IRQHandler(void)
{
	// Check to see which counter has triggered
	if (RTC->IF & RTC_IF_COMP0)
	{
		// Within 10 seconds allows us to speed up the clock for testing
		if ((RTC->CNT - time_keeper.timer_start_seconds) < 10)
		{
			run_sprinkler();
			RTC_CompareSet(0, time_keeper.timer_stop_seconds);
		}
		else
		{
			RTC_IntDisable(0);
			stop_sprinkler();
		}
		RTC_IntClear(RTC_IFC_COMP0);
	}
	else  // A minute update has occurred
	{
		if (RTC->CNT >= END_OF_DAY)
		{
			RTC->CNT = 0;
		}
		RTC_CompareSet(1, RTC->CNT + 60);
		RTC_IntClear(RTC_IFC_COMP1);
		display_hours = get_time(HOURS);
		display_minutes = get_time(MINUTES);
		display_time(display_hours, display_minutes);
	}
}
开发者ID:Rajusr70,项目名称:makersguide,代码行数:31,代码来源:main_sprinkler_timer.c

示例9: timer_complete

static void timer_complete(){
	//buzz, display, the whole nine
	running = false;
	text_layer_set_text(text_layer, "00:00");
	vibrate();
	display_time();
}
开发者ID:erisinger,项目名称:Pegg-Timer,代码行数:7,代码来源:Pegg-Timer.c

示例10: down_click_handler

static void down_click_handler(ClickRecognizerRef recognizer, void *context) {
	if (remaining >= 500 * 60) {
		add_time(-500 * 60);
	}
	
	display_time();
}
开发者ID:erisinger,项目名称:Pegg-Timer,代码行数:7,代码来源:Pegg-Timer.c

示例11: clock_task

/* clock_task: clock task */ 
void clock_task(void) 
{

    si_time next_time;
    /* local copies of the current time */ 
    int alarm_hours, alarm_minutes, alarm_seconds, hours, minutes, seconds, enable; 
    si_get_current_time(&next_time);
    /* infinite loop */ 
    while (1)
    {
        /* increment time */
		//printf("%d\n",1);
		increment_time();

        /* read and display current time */ 
		get_time(&hours, &minutes, &seconds, &enable);
		get_alarm_time(&alarm_hours, &alarm_minutes, &alarm_seconds);
		display_time(hours, minutes, seconds);
		
		if (enable && alarm_hours == hours && alarm_minutes == minutes && alarm_seconds == seconds)
		{
			enable_alarm();
		}
		si_time_add_n_ms(&next_time,1000);
        /* wait one second */ 
		si_wait_until_time(&next_time);
    }
}
开发者ID:adalu838,项目名称:datateknikreal,代码行数:29,代码来源:main.c

示例12: handle_minute_tick

void handle_minute_tick(AppContextRef ctx, PebbleTickEvent *t) 
{
  (void)t;
  (void)ctx;

  display_time(t->tick_time);
}
开发者ID:pebbleDevs,项目名称:arcadetime,代码行数:7,代码来源:OLD_arcadetime.paste.OLD.c

示例13: handle_second_tick

static void handle_second_tick(struct tm *tick_time, TimeUnits units_changed) {
    if (request_timezone_tries_left) {
        // If we don't already have a UTC offset, ask the phone for one.
        request_timezone();
    }
    display_time(tick_time);
}
开发者ID:sszk,项目名称:PebbleFace-beat,代码行数:7,代码来源:beat.c

示例14: handle_timer

void handle_timer(AppContextRef ctx, AppTimerHandle handle, uint32_t cookie) {
  (void)handle;
  if(cookie == TIMER_UPDATE) {
    if(started) {
      remaining_time -= 1;
      if (remaining_time == 0){
        if (working_mode){
          vibes_short_pulse();
        }
        else{
          vibes_double_pulse();
        }
        start_timer(SHORT_TIMER_DELAY);
      }else{
        if (remaining_time < 0){
          if (working_mode){
            reset_relax_count_down();
          }
          else{
            reset_work_count_down();
          }
        }else{
          display_time();
        }
        start_timer(TIMER_DELAY);
      }
    }
  }
}
开发者ID:juliengrenier,项目名称:pebble-pomodoro,代码行数:29,代码来源:pomodoro.c

示例15: main

int main()    
{	
	InitData();	 					
	
	while(1) {

		ReadTimeAndJudgeAlarmArrival();

		switch (mainLoop) {
		case 0:
			display_time();
			break;
		case 1:
			display_data();
			break;
		case 2:
			display_alarm();
			break;
		case 3:
			display_sWatch();
			break;
		}
		KeyScan();
	}

	return 0;
}
开发者ID:ZhengzhenZhang,项目名称:course-design,代码行数:27,代码来源:eClock.c


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