Mesure du temps en C sous Linux
Résolu
astroceline
Messages postés
9
Date d'inscription
Statut
Membre
Dernière intervention
-
asma -
asma -
Bonjour, j'aimerai savoir comment mesurer le temps d'exécution d'un programme en C sous Linux. La fonction clock valable sous Windows n'est plus valable sous Linux. Quelqu'un pourra-t-il m'aider ?
Merci de votre réponse.
Merci de votre réponse.
A voir également:
- Mesure du temps en C sous Linux
- Mesure en ligne - Guide
- Renommer plusieurs fichiers en même temps - Guide
- Linux reader - Télécharger - Stockage
- Maps satellite en temps réel - Guide
- Temps pour soi iphone - Guide
4 réponses
man 2 gettimeofday
<excerpt>
The functions gettimeofday and settimeofday can get and set the time as well as a timezone. The tv argument is a timeval struct, as specified in <sys/time.h>:
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
};
and gives the number of seconds and microseconds since the Epoch
</excerpt>
The software said "Requires Windows98, Win2000, or better,
So I installed Unix.
<excerpt>
The functions gettimeofday and settimeofday can get and set the time as well as a timezone. The tv argument is a timeval struct, as specified in <sys/time.h>:
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* microseconds */
};
and gives the number of seconds and microseconds since the Epoch
</excerpt>
The software said "Requires Windows98, Win2000, or better,
So I installed Unix.