Bonjour,
j'ai un code très simple :
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;
}
Je voudrais juste que ce qui est affiché s’incrémente or j'obtiens tout le temps 0.00...
Quelqu'un pourrait m'expliquer comment ça marche ?