Bonjour,
j'ai un code très simple :
Je voudrais juste que ce qui est affiché s’incrémente or j'obtiens tout le temps 0.00...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 #include <stdlib.h> #include <stdio.h> #include <string.h> #include <time.h> int i=0, k=0; int main() { for (i=0; i<15; i++) { printf("ticks: %f\n", (double)clock()); for (k=0;k<5; k++) {sleep(1);} } return 0; }
Quelqu'un pourrait m'expliquer comment ça marche ?
Partager