Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
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
1
B_141209_EsMayor
WAP in C to delete an element from an array
If Statement/ Decrement practice
ternar
z is 7
02468
joseph triangle
B_141121_factorial02
18BCE2182 ASSESS_1 Q1-6
Shapes and such