Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Timestamp microsecond for C
//TIme microsecond //gcc 7.4.0 //QubCIA #include <stdio.h> #include <stdint.h> #include <sys/time.h> int main(void) { struct timeval now; uint64_t timestamp; /* * Current time, represented as seconds and microseconds since * January 1, 1970, 00:00:00 UTC. */ gettimeofday(&now, NULL); /* * Convert to delta in microseconds. */ timestamp = (uint64_t)now.tv_sec * 1000000 + (uint64_t)now.tv_usec; printf("Timeval Sec.Usec = %lu.%lu\n", (uint64_t)now.tv_sec, (uint64_t)now.tv_usec); printf("Timestamp = %llu\n", timestamp); return 0; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
141128_EjemploChorraArray
Serie de Fibonacci
tickeParsing.c
str_ptr_to_fumc_v2
prime or not
BSEARCH() COMPLETE
My first array
fgets and basic string manipulation
A_141117_Primo02
Spring 2017 Lab 5 v1
Please log in to post a comment.