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

 


Dernière réponse
Sujet : [C++] Recuperation des millisecond courante
gilou

Citation :

Windows Time
Windows time is the number of milliseconds elapsed since the system started running. This format exists primarily for backward compatibility with 16-bit Windows. To ensure that applications designed for 16-bit Windows continue to run successfully, the GetTickCount function returns the current Windows time.  
 
You typically use GetTickCount to compare the current Windows time with the time returned by the GetMessageTime function. GetMessageTime returns the Windows time when the specified message was created. GetTickCount is limited to the resolution of the system timer.  
 
Windows NT 3.5 and later: The system timer runs at approximately 10ms.  
 
Windows NT 3.1: The system timer runs at approximately 16ms.  
 
Windows 95/98/Me: The system timer runs at approximately 55ms.
 
If you need a higher resolution timer, use a multimedia timer or a high-resolution timer.
 
Windows time is stored as a 32-bit value, which means the system can record no more than 2^32 millisecond intervals before the 32-bit value overflows to zero. This is approximately 49.7 days. If you use Windows time, check for the overflow condition when comparing times.  
 
Windows NT/2000/XP: You can use the System Up Time performance counter to obtain the time elapsed since the computer was started.


 
A+,


Votre réponse
Nom d'utilisateur    Pour poster, vous devez être inscrit sur ce forum .... si ce n'est pas le cas, cliquez ici !
Le ton de votre message                        
                       
Votre réponse


[b][i][u][strike][spoiler][fixed][cpp][url][email][img][*]   
 
   [quote]
 

Options

 
Vous avez perdu votre mot de passe ?


Vue Rapide de la discussion
gilou

Citation :

Windows Time
Windows time is the number of milliseconds elapsed since the system started running. This format exists primarily for backward compatibility with 16-bit Windows. To ensure that applications designed for 16-bit Windows continue to run successfully, the GetTickCount function returns the current Windows time.  
 
You typically use GetTickCount to compare the current Windows time with the time returned by the GetMessageTime function. GetMessageTime returns the Windows time when the specified message was created. GetTickCount is limited to the resolution of the system timer.  
 
Windows NT 3.5 and later: The system timer runs at approximately 10ms.  
 
Windows NT 3.1: The system timer runs at approximately 16ms.  
 
Windows 95/98/Me: The system timer runs at approximately 55ms.
 
If you need a higher resolution timer, use a multimedia timer or a high-resolution timer.
 
Windows time is stored as a 32-bit value, which means the system can record no more than 2^32 millisecond intervals before the 32-bit value overflows to zero. This is approximately 49.7 days. If you use Windows time, check for the overflow condition when comparing times.  
 
Windows NT/2000/XP: You can use the System Up Time performance counter to obtain the time elapsed since the computer was started.


 
A+,

LeGreg gettickcount c'est pour du gros oeuvre
pour quelque chose de precis
faut regarder du cote des multimedia timer
ou performance counters.
 
c'est sur la MSDN je sais plus quelle rubrique
 
A+
LEGREG
antp pour des machins temps réel y a des OS prévus pour ça, par ex QNX
Tetragrammaton IHVH Attention avec ce genre de fonction : C'est limité par le temps minimum alloué à chaque process. Sur Win98, c'est 55 ms (de mémoire) sur Win2k et plus c'est 10 ms (aussi de mémoire). Le temps sur PC est discontinu.
sultant j'ai essayé cette fonction et ca donnel exactement le meme resultat qu'avec GetTickCount() donc par soucit d'obtimisation je vais prendre un GetTickCount()  
Merci quand meme
 
au est ce que l'export d'un fichier txt  de 6 ko se fait en 110 ms ? ca parait plausible ?
madforever tu peux utiliser la fonction suivante :  
 
 
SYSTEMTIME st;
 
GetSystemTime(&st);
 
str.Format ("%d%d%d%d", st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
 
 
la fonction se trouve dans <time.h>
sultant merci  
but tu connais peut etre alors une autre fonction qui permet de  
d'obtenir l'heure system a la milliseconde prés  
 
merci encore  
sultant
Carbon_14 Je ne sais pas s'il s'est amélioré, mais la semaine dernière, sous Win3.11, je me suis rendu compte que ce que je craignais arrive : GetTickCount() donne bien des ms, mais à 65ms près... Je voulais m'en servir pour faire un chrono à l milliseconde voire plus (pour une carte conv A/D). Raté (j'ai dû reprogrammer le 8253 interne)
 
Peut-être qu'en 32 bits, c'est plus "précis" à moins qu'il y ait une fonction spéciale.  
Les Ticks, y en a 18,6 par seconde. Si on les compte (..TickCount), on a pas plus de précision quoi qu'on fasse (mais ça peut suffire !).
sultant j'ai trouver une fonction permettant d'obtenir un temps  de puis que le systeme est en marche
 
getTickCount();
 
donc plus besoin d'aide
sultant Ba voila je crois que le sujet est assez précis.
Je veux savoir s'il est possible de recuperer les  
milliseconde  courrante de l'heure courrante
 
car en utilisant CTime  
CTime ludo = CTime::GetCurrentTime();
CString str;
str.Format("%d%d%d",ludo.GetHour(),ludo.GetMin(),ludo.GetSecond());
// y a po GetMillisecond
 
 
Kelkun auriait une idée  
 
Merci d'avance .

Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)