Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1188 connectés 

  FORUM HardWare.fr
  Programmation
  C++

  gettimeofday sous win

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

gettimeofday sous win

n°1292198
tomi_tomo
Posté le 25-01-2006 à 19:04:25  profilanswer
 

Salut,
Je cherche une fonction semblable a gettimeofday de unix sous windows un truc precis a la microseconde ou au millieme de seconde.
Merci.
parceque time() c'est pas tres precis je sais pas si je sais pas men servir mais il m'ecrit toujours 0 mm si je fais 30 printf =[.

mood
Publicité
Posté le 25-01-2006 à 19:04:25  profilanswer
 

n°1292219
breizhbugs
Posté le 25-01-2006 à 20:02:16  profilanswer
 

SAlut,
vois http://msdn.microsoft.com/library/ [...] kcount.asp comme point de depart

n°1292226
tomi_tomo
Posté le 25-01-2006 à 20:14:55  profilanswer
 

ca ma l'aire nickel ca !!!
Merci c cool javais pas trouver.

n°1292247
fat
Posté le 25-01-2006 à 20:50:51  profilanswer
 

la fonction GetSystemTimeAsFileTime renvoit une heure avec une précision de 0.1 microseconde

n°1292423
Joel F
Real men use unique_ptr
Posté le 26-01-2006 à 09:35:12  profilanswer
 

Code :
  1. #include <windows.h>
  2. // /////////////////////////////////////////////////////////////////////////
  3. // Evaluates time at a given spot.
  4. // /////////////////////////////////////////////////////////////////////////
  5. double  Now()
  6. {
  7.   LARGE_INTEGER tick, freq;
  8.   freq = GetFrequency();
  9.   QueryPerformanceCounter(&tick);
  10.   return tick.QuadPart / freq.QuadPart;
  11. }
  12. // /////////////////////////////////////////////////////////////////////////
  13. // Win32 timing specific function.
  14. // Returns 0 on non-capable machines (Pentium 75 & inferior mostly)
  15. // /////////////////////////////////////////////////////////////////////////
  16. LARGE_INTEGER GetFrequency()
  17. {
  18.   LARGE_INTEGER freq;
  19.   QueryPerformanceFrequency(&freq);
  20.   return freq;
  21. }


 

Code :
  1. // Utilisation  
  2. double t0 = Now();
  3. // Some code
  4. double t1 = Now() - t0;
  5. cout << "Temps ecoule en s : " << t1 << endl;


 

n°1292997
tomi_tomo
Posté le 26-01-2006 à 19:47:09  profilanswer
 

oki merci c cool de mavoir aider :D


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  C++

  gettimeofday sous win

 

Sujets relatifs
Equivalent de gettimeofday sous win 
Plus de sujets relatifs à : gettimeofday sous win


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR