bonjour
je travaille sur un projet visual c++ /CLR mode console
comment faire pour récupérer l'horloge système en microseconde
Affichage heure:minute:seconde:microseconde
le programme suivant marche très bien mais compatible avec d'autres plateformes:
1000 merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 #include <stdio.h> #include <sys/time.h> int main(void) { struct timeval tv; struct timezone tz; struct tm *tm; gettimeofday(&tv, &tz); tm=localtime(&tv.tv_sec); printf(" %d:%02d:%02d %ld \n", tm->tm_hour, tm->tm_min,tm->tm_sec, tv.tv_usec); return 0; }
Partager