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

C++ display_time函数代码示例

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

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



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


示例16: handle_init

void handle_init() {

  // Configure window
  window = window_create();
  window_stack_push(window, true /* Animated */);
  window_set_background_color(window, BKGD_COLOR);
  window_set_fullscreen(window, true);
  Layer *window_layer = window_get_root_layer(window);

  // Dynamic allocation of assets
  minuteFrame = GRect(53, 16, 40, 40);
  minuteLayer = text_layer_create(minuteFrame);
  hourLayer = bitmap_layer_create(GRect(0, 0, 144, 148));
  batteryLogoLayer = bitmap_layer_create(GRect(65, 151, 10, 15));
  batteryPercentLayer = text_layer_create(GRect(78, 150, 30, 167-150));
  dateLayer = text_layer_create(GRect(3, 150, 38, 167-150));
  dayLayer = text_layer_create(GRect(141-30, 150, 30, 167-150));
  text_layer_set_text_alignment(dayLayer, GTextAlignmentRight);
  bottomBarLayer = layer_create(GRect(1, 149, 142, 18));

  // Setup minute layer
  text_layer_set_text_color(minuteLayer, TEXT_COLOR);
  text_layer_set_background_color(minuteLayer, GColorClear);
  text_layer_set_font(minuteLayer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_MINUTE_38)));

  // Setup date & day layer
  text_layer_set_text_color(dateLayer, TEXT_COLOR);
  text_layer_set_background_color(dateLayer, GColorClear);
  text_layer_set_text_color(dayLayer, TEXT_COLOR);
  text_layer_set_background_color(dayLayer, GColorClear);

  // Setup battery layers
  text_layer_set_text_color(batteryPercentLayer, TEXT_COLOR);
  text_layer_set_background_color(batteryPercentLayer, GColorClear);

  // Setup line layer
  layer_set_update_proc(bottomBarLayer, bottom_bar_layer_update_callback);

  // Add layers into hierachy
  layer_add_child(bitmap_layer_get_layer(hourLayer), text_layer_get_layer(minuteLayer));
  layer_add_child(window_layer, bitmap_layer_get_layer(hourLayer));
  layer_add_child(window_layer, bottomBarLayer);
  layer_add_child(window_layer, bitmap_layer_get_layer(batteryLogoLayer));
  layer_add_child(window_layer, text_layer_get_layer(batteryPercentLayer));
  layer_add_child(window_layer, text_layer_get_layer(dateLayer));
  layer_add_child(window_layer, text_layer_get_layer(dayLayer));

  // Avoids a blank screen on watch start.
  time_t tick_time = time(NULL);
  display_time(localtime(&tick_time));
  handle_battery(battery_state_service_peek());
  handle_bluetooth(bluetooth_connection_service_peek());

  tick_timer_service_subscribe(MINUTE_UNIT, &handle_minute_tick);
  battery_state_service_subscribe(&handle_battery);
  bluetooth_connection_service_subscribe(&handle_bluetooth);

  initialized = true;
}
开发者ID:bosphere,项目名称:pebble-bold-hour-enhanced,代码行数:59,代码来源:bold-hour-enhanced.c


示例17: handle_cmd_measurement_peak

int handle_cmd_measurement_peak(uint8_t *buffer, short length)
{
	unsigned int data;
	if(length != 5) return FAIL;
	display_time();
	data = (*(buffer+4)<<16) | (*(buffer+3)<<8) | (*(buffer+2));
	printf("CMD_MEAS_PEAK: %16u\n", data);
	return OK;
}
开发者ID:akandr,项目名称:wvwms_commands,代码行数:9,代码来源:wvwms_display.c


示例18: show_time

static void show_time(struct tm *tick_time) {
  clock_time = tick_time;
  display_time();

  if (tick_time->tm_min == 0 || !date_shown) {
    show_weeks(tick_time->tm_mon,tick_time->tm_mday,tick_time->tm_wday,tick_time->tm_year);
    date_shown = true;
  }
}
开发者ID:michaelbreyes,项目名称:BlissTime,代码行数:9,代码来源:clock.c


示例19: basic_prg

static prg_t basic_prg(void)
{
	char cnt = 0;

	for (;;)
	{
		if (HOUR || MINU)
		{
			if (!--d_s)
			{
				if (MINU)
					MINU--;
				else if (HOUR)
				{
					HOUR--;
					MINU = 59;
				}

				if (!MINU && !HOUR)
					next_timer();

				if (!power[0])
					return PRG_SHOW_STOP;

				d_s = 60*4;
			}
		}
		if ((MINU || HOUR) && cnt++ & 0x4)
			display_time(HOUR, MINU);
		else
			display_int(power[0]);

		switch (buttons_get())
		{
		case BTN_UP:
		case BTN_UP_LONG:
			power_inc(0);
			cnt = 0;
			break;

		case BTN_DOWN:
		case BTN_DOWN_LONG:
			power_dec(0);
			cnt = 0;
			break;

		case BTN_BOTH:
			return PRG_SET_TIMER1;

		case BTN_IDLE:
		case BTN_UNDEFINED:
		case BTN_RESET:
			break;
		}
		sleep();
	}
}
开发者ID:ileshenko,项目名称:stove,代码行数:57,代码来源:main.c


示例20: display_qvariant

int display_qvariant(char *buf) {
	char *orig_buf=buf;
	uint32_t type = *((uint32_t*)buf);
	type=ntohl(type);
	buf+=4;
	char null=*buf;
	buf++;
	if(null) {
		//Nothing to do
	}
	switch(type) {
		case 1:
			buf+=display_bool(buf);
			break;
		case 2:
		case 3:
			buf+=display_int(buf, type);
			break;
		case 7:
			//UTF16 byte
			buf+=display_short(buf);
			break;
		case 8:
			buf+=display_map(buf);
			break;
		case 9:
			buf+=display_list(buf);
			break;
		case 10:
			buf+=display_string(buf);
			break;
		case 11:
			buf+=display_stringlist(buf);
			break;
		case 12:
			buf+=display_bytearray(buf);
			break;
		case 15:
			buf+=display_time(buf);
			break;
		case 16:
			buf+=display_date(buf);
			break;
		case 127:
			//User type !
			buf+=display_usertype(buf);
			break;
		case 133:
			buf+=display_short(buf);
			break;
		default:
			printf("Unknown QVariant type: %d\n", type);
			exit(-1);
			break;
	};
	return buf-orig_buf;
}
开发者ID:fuzzball81,项目名称:QuasselC,代码行数:57,代码来源:display.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ display_usage函数代码示例发布时间:2022-05-30
下一篇:
C++ display_symbol函数代码示例发布时间: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