您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ timestamp_init函数代码示例

51自学网 2021-06-03 08:51:59
  C++
这篇教程C++ timestamp_init函数代码示例写得很实用,希望能帮到您。

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

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

示例1: file_query_posix_

void file_query_posix_( file_info_t * const info ){    struct stat statbuf;    char const * const pathstr = object_str( info->name );    char const * const pathspec = *pathstr ? pathstr : ".";    if ( stat( pathspec, &statbuf ) < 0 )    {        info->is_file = 0;        info->is_dir = 0;        info->exists = 0;        timestamp_clear( &info->time );    }    else    {        info->is_file = statbuf.st_mode & S_IFREG ? 1 : 0;        info->is_dir = statbuf.st_mode & S_IFDIR ? 1 : 0;        info->exists = 1;#if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809#if defined(OS_MACOSX)        timestamp_init( &info->time, statbuf.st_mtimespec.tv_sec, statbuf.st_mtimespec.tv_nsec );#else        timestamp_init( &info->time, statbuf.st_mtim.tv_sec, statbuf.st_mtim.tv_nsec );#endif#else        timestamp_init( &info->time, statbuf.st_mtime, 0 );#endif    }}
开发者ID:LocutusOfBorg,项目名称:poedit,代码行数:29,


示例2: file_supported_fmt_resolution

void file_supported_fmt_resolution( timestamp * const t ){#if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809    timestamp_init( t, 0, 1 );#else    /* The current implementation does not support file modification timestamp     * resolution of less than one second.     */    timestamp_init( t, 1, 0 );#endif}
开发者ID:LocutusOfBorg,项目名称:poedit,代码行数:11,


示例3: file_query

file_info_t * file_query( OBJECT * const path ){    /* FIXME: Add tracking for disappearing files (i.e. those that can not be     * detected by stat() even though they had been detected successfully     * before) and see how they should be handled in the rest of Boost Jam code.     * Possibly allow Jamfiles to specify some files as 'volatile' which would     * make Boost Jam avoid caching information about those files and instead     * ask the OS about them every time.     *     * FIXME: Consider returning a clear file_info() result here if     * file_query_() fails. Should simplify the caller side error checking and     * the caller still can and needs to detect whether the file has not been     * successfully detected by the OS, i.e. whether the file_query() call     * failed.     */    file_info_t * const ff = file_info( path );    if ( timestamp_empty( &ff->time ) )    {        if ( file_query_( ff ) < 0 )            return 0;        /* Set the path's timestamp to 1 in case it is 0 or undetected to avoid         * confusion with non-existing paths.         */        if ( timestamp_empty( &ff->time ) )            timestamp_init( &ff->time, 1, 0 );    }    return ff;}
开发者ID:CarterTsai,项目名称:clasp,代码行数:29,


示例4: romstage_init

void romstage_init(void){	void *entry;	#if CONFIG_COLLECT_TIMESTAMPS	uint64_t start_romstage_time;	uint64_t before_dram_time;	uint64_t after_dram_time;	uint64_t base_time = timestamp_get();	start_romstage_time = timestamp_get();#endif	rkclk_set_pll();	console_init();#if CONFIG_COLLECT_TIMESTAMPS	before_dram_time = timestamp_get();#endif	dram_main();#if CONFIG_COLLECT_TIMESTAMPS	after_dram_time = timestamp_get();#endif	udelay(100);	cbmem_initialize_empty();#if CONFIG_COLLECT_TIMESTAMPS	timestamp_init(base_time);	timestamp_add(TS_START_ROMSTAGE, start_romstage_time );	timestamp_add(TS_BEFORE_INITRAM, before_dram_time );	timestamp_add(TS_AFTER_INITRAM, after_dram_time );#endif	entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/coreboot_ram");#if CONFIG_COLLECT_TIMESTAMPS	timestamp_add_now(TS_END_ROMSTAGE);#endif	stage_exit(entry);}
开发者ID:kleopatra999,项目名称:coreboot,代码行数:33,


示例5: file_supported_fmt_resolution

void file_supported_fmt_resolution( timestamp * const t ){    /* The current implementation does not support file modification timestamp     * resolution of less than one second.     */    timestamp_init( t, 1, 0 );}
开发者ID:Cabriter,项目名称:abelkhan,代码行数:7,


示例6: benchmarks_ssh_latency

/** @internal * @brief Calculates the RTT of the host with SSH channel operations, and * returns the average of the calculated RTT. * @param[in] session active SSH session to test. * @param[out] average average RTT in milliseconds. * @returns 0 on success, -1 if there is an error. */int benchmarks_ssh_latency(ssh_session session, float *average){  float times[3];  struct timestamp_struct ts;  int i;  ssh_channel channel;  channel=ssh_channel_new(session);  if(channel==NULL)    goto error;  if(ssh_channel_open_session(channel)==SSH_ERROR)    goto error;  for(i=0;i<3;++i){    timestamp_init(&ts);    if(ssh_channel_request_env(channel,"TEST","test")==SSH_ERROR &&        ssh_get_error_code(session)==SSH_FATAL)      goto error;    times[i]=elapsed_time(&ts);  }  ssh_channel_close(channel);  ssh_channel_free(channel);  channel=NULL;  printf("Times : %f ms ; %f ms ; %f ms/n", times[0], times[1], times[2]);  *average=(times[0]+times[1]+times[2])/3;  return 0;error:  fprintf(stderr,"Error calculating SSH latency : %s/n",ssh_get_error(session));  if(channel)    ssh_channel_free(channel);  return -1;}
开发者ID:FuckingCoder,项目名称:libssh,代码行数:37,


示例7: file_query

file_info_t * file_query( OBJECT * const path ){    /* FIXME: Add tracking for disappearing files (i.e. those that can not be     * detected by stat() even though they had been detected successfully     * before) and see how they should be handled in the rest of Boost Jam code.     * Possibly allow Jamfiles to specify some files as 'volatile' which would     * make Boost Jam avoid caching information about those files and instead     * ask the OS about them every time.     */    int found;    file_info_t * const ff = file_info( path, &found );    if ( !found )    {        file_query_( ff );        if ( ff->exists )        {            /* Set the path's timestamp to 1 in case it is 0 or undetected to avoid             * confusion with non-existing paths.             */            if ( timestamp_empty( &ff->time ) )                timestamp_init( &ff->time, 1, 0 );        }    }    if ( !ff->exists )    {        return 0;    }    return ff;}
开发者ID:LocutusOfBorg,项目名称:poedit,代码行数:29,


示例8: main

void main(void){	extern struct mem_timings mem_timings;	int is_resume = (get_wakeup_state() != IS_NOT_WAKEUP);	int power_init_failed;	exynos5420_config_smp();	power_init_failed = setup_power(is_resume);	timestamp_init(timestamp_get());	timestamp_add_now(TS_START_ROMSTAGE);	/* Clock must be initialized before console_init, otherwise you may need	 * to re-initialize serial console drivers again. */	system_clock_init();	exynos_pinmux_uart3();	console_init();	exception_init();	if (power_init_failed)		die("Failed to intialize power./n");	/* re-initialize PMIC I2C channel after (re-)setting system clocks */	i2c_init(PMIC_I2C_BUS, 1000000, 0x00); /* 1MHz */	timestamp_add_now(TS_BEFORE_INITRAM);	setup_memory(&mem_timings, is_resume);	timestamp_add_now(TS_AFTER_INITRAM);	primitive_mem_test();	trustzone_init();	if (is_resume) {		wakeup();	}	setup_gpio();	setup_ec();	simple_spi_test();	/* Set SPI (primary CBFS media) clock to 50MHz. */	/* if this is uncommented SPI will not work correctly. */	clock_set_rate(PERIPH_ID_SPI1, 50000000);	exynos_pinmux_spi1();	simple_spi_test();	cbmem_initialize_empty();	simple_spi_test();	timestamp_add_now(TS_END_ROMSTAGE);	run_ramstage();}
开发者ID:bitpick,项目名称:coreboot,代码行数:59,


示例9: stopwatch_stop

void stopwatch_stop(struct stopwatch *timer, const struct timestamp *now){  if ((STOPWATCH_ACTIVE(timer))) {    timestamp_add(&timer->total, now);    timestamp_sub(&timer->total, &timer->start);    timestamp_init(&timer->start);  } else {    //DEBUG_ONLY(NONFATAL("Stopping inactive stopwatch."));  }}
开发者ID:huangl0,项目名称:funcy,代码行数:10,


示例10: arch_cpu_init

int arch_cpu_init(void){	int ret = get_coreboot_info(&lib_sysinfo);	if (ret != 0) {		printf("Failed to parse coreboot tables./n");		return ret;	}	timestamp_init();	return x86_cpu_init_f();}
开发者ID:OpenNoah,项目名称:u-boot,代码行数:12,


示例11: timestamp_current

void timestamp_current( timestamp * const t ){#ifdef OS_NT    /* GetSystemTimeAsFileTime()'s resolution seems to be about 15 ms on Windows     * XP and under a millisecond on Windows 7.     */    FILETIME ft;    GetSystemTimeAsFileTime( &ft );    timestamp_from_filetime( t, &ft );#else  /* OS_NT */    timestamp_init( t, time( 0 ), 0 );#endif  /* OS_NT */}
开发者ID:jzmaddock,项目名称:build,代码行数:13,


示例12: collect_archive_content_big

static void collect_archive_content_big( int fd, file_archive_info_t * const archive ){    struct fl_hdr_big fl_hdr;    struct {        struct ar_hdr_big hdr;        char pad[ 256 ];    } ar_hdr ;    char buf[ MAXJPATH ];    long long offset;    const char * path = object_str( archive->file->name );    if ( read( fd, (char *)&fl_hdr, FL_HSZ_BIG ) != FL_HSZ_BIG )        return;    sscanf( fl_hdr.fl_fstmoff, "%lld", &offset );    if ( DEBUG_BINDSCAN )        out_printf( "scan archive %s/n", path );    while ( offset > 0 && lseek( fd, offset, 0 ) >= 0 &&            read( fd, &ar_hdr, sizeof( ar_hdr ) ) >= sizeof( ar_hdr.hdr ) )    {        long lar_date;        int lar_namlen;        sscanf( ar_hdr.hdr.ar_namlen, "%d"  , &lar_namlen );        sscanf( ar_hdr.hdr.ar_date  , "%ld" , &lar_date   );        sscanf( ar_hdr.hdr.ar_nxtmem, "%lld", &offset     );        if ( !lar_namlen )            continue;        ar_hdr.hdr._ar_name.ar_name[ lar_namlen ] = '/0';        sprintf( buf, "%s", ar_hdr.hdr._ar_name.ar_name );        if ( strcmp( buf, "") != 0 )        {            file_info_t * member = 0;            archive->members = filelist_push_back( archive->members, object_new( buf ) );            member = filelist_back( archive->members );            member->is_file = 1;            member->is_dir = 0;            member->exists = 0;            timestamp_init( &member->time, (time_t)lar_date, 0 );        }    }}
开发者ID:Cabriter,项目名称:abelkhan,代码行数:51,


示例13: plugin_init

static void plugin_init(OhmPlugin *plugin){    OHM_DEBUG_INIT(playback);    client_init(plugin);    media_init(plugin);    pbreq_init(plugin);    sm_init(plugin);    dbusif_init(plugin);    dresif_init(plugin);    fsif_init(plugin);    timestamp_init();}
开发者ID:arcean,项目名称:ohm-plugins-misc,代码行数:14,


示例14: __attribute__

static void __attribute__((noinline)) romstage(void){	timestamp_init(0);	timestamp_add_now(TS_START_ROMSTAGE);	console_init();	exception_init();	sdram_init(get_sdram_config());	/* used for MMU and CBMEM setup, in MB */	u32 dram_start_mb = (uintptr_t)_dram/MiB;	u32 dram_end_mb = sdram_max_addressable_mb();	u32 dram_size_mb = dram_end_mb - dram_start_mb;	configure_l2_cache();	mmu_init();	/* Device memory below DRAM is uncached. */	mmu_config_range(0, dram_start_mb, DCACHE_OFF);	/* SRAM is cached. MMU code will round size up to page size. */	mmu_config_range((uintptr_t)_sram/MiB, div_round_up(_sram_size, MiB),			 DCACHE_WRITEBACK);	/* DRAM is cached. */	mmu_config_range(dram_start_mb, dram_size_mb, DCACHE_WRITEBACK);	/* A window for DMA is uncached. */	mmu_config_range((uintptr_t)_dma_coherent/MiB,			 _dma_coherent_size/MiB, DCACHE_OFF);	/* The space above DRAM is uncached. */	if (dram_end_mb < 4096)		mmu_config_range(dram_end_mb, 4096 - dram_end_mb, DCACHE_OFF);	mmu_disable_range(0, 1);	dcache_mmu_enable();	/*	 * A watchdog reset only resets part of the system so it ends up in	 * a funny state. If that happens, we need to reset the whole machine.	 */	if (power_reset_status() == POWER_RESET_WATCHDOG) {		printk(BIOS_INFO, "Watchdog reset detected, rebooting./n");		hard_reset();	}	/* FIXME: this may require coordination with moving timestamps */	cbmem_initialize_empty();	early_mainboard_init();	run_ramstage();}
开发者ID:AdriDlu,项目名称:coreboot,代码行数:49,


示例15: main

void main(void){#if CONFIG_COLLECT_TIMESTAMPS	uint64_t start_romstage_time;	uint64_t before_dram_time;	uint64_t after_dram_time;	uint64_t base_time = timestamp_get();	start_romstage_time = timestamp_get();#endif	console_init();	configure_l2ctlr();	tsadc_init();	/* vdd_log 1200mv is enough for ddr run 666Mhz */	regulate_vdd_log(1200);#if CONFIG_COLLECT_TIMESTAMPS	before_dram_time = timestamp_get();#endif	sdram_init(get_sdram_config());#if CONFIG_COLLECT_TIMESTAMPS	after_dram_time = timestamp_get();#endif	/* Now that DRAM is up, add mappings for it and DMA coherency buffer. */	mmu_config_range((uintptr_t)_dram/MiB,			 sdram_size_mb(), DCACHE_WRITEBACK);	mmu_config_range((uintptr_t)_dma_coherent/MiB,			 _dma_coherent_size/MiB, DCACHE_OFF);	cbmem_initialize_empty();#if CONFIG_COLLECT_TIMESTAMPS	timestamp_init(base_time);	timestamp_add(TS_START_ROMSTAGE, start_romstage_time);	timestamp_add(TS_BEFORE_INITRAM, before_dram_time);	timestamp_add(TS_AFTER_INITRAM, after_dram_time);	timestamp_add_now(TS_END_ROMSTAGE);#endif#if IS_ENABLED(CONFIG_VBOOT_VERIFY_FIRMWARE)	void *entry = vboot2_load_ramstage();	if (entry != NULL)		stage_exit(entry);#endif	run_ramstage();}
开发者ID:zamaudio,项目名称:coreboot,代码行数:48,


示例16: file_query_posix_

int file_query_posix_( file_info_t * const info ){    struct stat statbuf;    char const * const pathstr = object_str( info->name );    char const * const pathspec = *pathstr ? pathstr : ".";    assert( timestamp_empty( &info->time ) );    if ( stat( pathspec, &statbuf ) < 0 )        return -1;    info->is_file = statbuf.st_mode & S_IFREG ? 1 : 0;    info->is_dir = statbuf.st_mode & S_IFDIR ? 1 : 0;    timestamp_init( &info->time, statbuf.st_mtime, 0 );    return 0;}
开发者ID:CarterTsai,项目名称:clasp,代码行数:16,


示例17: bootblock_soc_init

void bootblock_soc_init(void){	timestamp_init(timestamp_get());	rkclk_init();	mmu_init();	/* Start with a clean slate. */	mmu_config_range(0, 4096, DCACHE_OFF);	/* SRAM is tightly wedged between registers, need to use subtables. Map	 * write-through as equivalent for non-cacheable without XN on A17. */	mmu_config_range_kb((uintptr_t)_sram/KiB,			    _sram_size/KiB, DCACHE_WRITETHROUGH);	dcache_mmu_enable();	rkclk_configure_crypto(148500*KHz);}
开发者ID:MikeeHawk,项目名称:coreboot,代码行数:17,


示例18: main

void main(void){	init_timer();	if (IS_ENABLED(CONFIG_HAS_PRECBMEM_TIMESTAMP_REGION))		timestamp_init(timestamp_get());	bootblock_mainboard_early_init();#if CONFIG_BOOTBLOCK_CONSOLE	console_init();	exception_init();#endif	bootblock_soc_init();	bootblock_mainboard_init();	run_romstage();}
开发者ID:RafaelRMachado,项目名称:Coreboot,代码行数:18,


示例19: frametimes_init_base

static voidframetimes_init_base(GH_frametimes *ft){	/* get the base timestamp */	if (ft->mode > GH_FRAMETIME_NONE) {		GH_timestamp base;		unsigned int i;		GH_frametime *last=&ft->frametime[ft->num_results * ft->num_timestamps];		timestamp_init(&base);		timestamp_set(&base, &last[0], ft->mode);		timestamp_set(&base, &last[0], ft->mode);		for (i=1; i<ft->num_timestamps; i++) {			last[i]=last[0];		}		timestamp_cleanup(&base);	}}
开发者ID:derhass,项目名称:glx_hook,代码行数:18,


示例20: timestamp_from_filetime

void timestamp_from_filetime( timestamp * const t, FILETIME const * const ft ){    /* Seconds between 1.1.1601 and 1.1.1970 */    static __int64 const secs_between_epochs = 11644473600;    /* We can not simply cast and dereference a FILETIME, since it might not be     * aligned properly. __int64 type variables are expected to be aligned to an     * 8 byte boundary while FILETIME structures may be aligned to any 4 byte     * boundary. Using an incorrectly aligned __int64 variable may cause a     * performance penalty on some platforms or even exceptions on others     * (documented on MSDN).     */    __int64 in;    memcpy( &in, ft, sizeof( in ) );    /* FILETIME resolution: 100ns. */    timestamp_init( t, (time_t)( ( in / 10000000 ) - secs_between_epochs ),        (int)( in % 10000000 ) * 100 );}
开发者ID:jzmaddock,项目名称:build,代码行数:19,


示例21: bootblock_main_with_timestamp

asmlinkage void bootblock_main_with_timestamp(uint64_t base_timestamp){	/* Initialize timestamps if we have TIMESTAMP region in memlayout.ld. */	if (IS_ENABLED(CONFIG_COLLECT_TIMESTAMPS) && _timestamp_size > 0)		timestamp_init(base_timestamp);	cmos_post_init();	bootblock_soc_early_init();	bootblock_mainboard_early_init();	if (IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) {		console_init();		exception_init();	}	bootblock_soc_init();	bootblock_mainboard_init();	run_romstage();}
开发者ID:lynxis,项目名称:coreboot-signed,代码行数:21,


示例22: romstage_main

void * asmlinkage romstage_main(unsigned long bist){	int cbmem_was_initted;	/* init_timer(); */	post_code(0x05);	i82801ix_early_init();	console_init();	/* Halt if there was a built in self test failure */	report_bist_failure(bist);	cbmem_was_initted = !cbmem_recovery(0);	timestamp_init(timestamp_get());	timestamp_add_now(TS_START_ROMSTAGE);	/* Emulation uses fixed low stack during ramstage. */	return NULL;}
开发者ID:lynxis,项目名称:coreboot-signed,代码行数:21,


示例23: main

void main(unsigned long bist){	int cbmem_was_initted;	/* init_timer(); */	post_code(0x05);	console_init();	/* Halt if there was a built in self test failure */	report_bist_failure(bist);	//print_pci_devices();	//dump_pci_devices();	cbmem_was_initted = !cbmem_recovery(0);	timestamp_init(timestamp_get());	timestamp_add_now(TS_START_ROMSTAGE);}
开发者ID:MrTomasz,项目名称:coreboot,代码行数:21,


示例24: file_query_posix_

void file_query_posix_( file_info_t * const info ){    struct stat statbuf;    char const * const pathstr = object_str( info->name );    char const * const pathspec = *pathstr ? pathstr : ".";    if ( stat( pathspec, &statbuf ) < 0 )    {        info->is_file = 0;        info->is_dir = 0;        info->exists = 0;        timestamp_clear( &info->time );    }    else    {        info->is_file = statbuf.st_mode & S_IFREG ? 1 : 0;        info->is_dir = statbuf.st_mode & S_IFDIR ? 1 : 0;        info->exists = 1;        timestamp_init( &info->time, statbuf.st_mtime, 0 );    }}
开发者ID:Cabriter,项目名称:abelkhan,代码行数:21,


示例25: romstage_main

/* Entry from cache-as-ram.inc. */void * asmlinkage romstage_main(unsigned long bist,                                uint32_t tsc_low, uint32_t tsc_hi){	struct romstage_params rp = {		.bist = bist,		.mrc_params = NULL,	};	/* Save initial timestamp from bootblock. */	timestamp_init((((uint64_t)tsc_hi) << 32) | (uint64_t)tsc_low);	/* Save romstage begin */	timestamp_add_now(TS_START_ROMSTAGE);	program_base_addresses();	tco_disable();	byt_config_com1_and_enable();	console_init();	spi_init();	set_max_freq();	punit_init();	gfx_init();#if CONFIG_EC_GOOGLE_CHROMEEC	/* Ensure the EC is in the right mode for recovery */	google_chromeec_early_init();#endif	/* Call into mainboard. */	mainboard_romstage_entry(&rp);	return setup_stack_and_mttrs();}
开发者ID:bitpick,项目名称:coreboot,代码行数:41,



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


C++ timestr函数代码示例
C++ timestamp_get函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。