<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://knowledge.pinon-hebert.fr/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Temps_%C3%A0_la_milliseconde_en_C</id>
	<title>Temps à la milliseconde en C - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://knowledge.pinon-hebert.fr/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Temps_%C3%A0_la_milliseconde_en_C"/>
	<link rel="alternate" type="text/html" href="https://knowledge.pinon-hebert.fr/mediawiki/index.php?title=Temps_%C3%A0_la_milliseconde_en_C&amp;action=history"/>
	<updated>2026-05-19T11:25:13Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://knowledge.pinon-hebert.fr/mediawiki/index.php?title=Temps_%C3%A0_la_milliseconde_en_C&amp;diff=1792&amp;oldid=prev</id>
		<title>Jpinon le 14 janvier 2026 à 13:20</title>
		<link rel="alternate" type="text/html" href="https://knowledge.pinon-hebert.fr/mediawiki/index.php?title=Temps_%C3%A0_la_milliseconde_en_C&amp;diff=1792&amp;oldid=prev"/>
		<updated>2026-01-14T13:20:05Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 14 janvier 2026 à 13:20&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Ligne 1 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 1 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Autant en java ou en python gérer le temps en millisecondes est standard. En C c&amp;#039;est pas si simple.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Autant en java ou en python gérer le temps en millisecondes est standard. En C c&amp;#039;est pas si simple.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Certes en C dans l&#039;environnement [[Arduino]] c&#039;est facile, un simple milis() donne le nombre de millisecondes depuis le boot &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;en &lt;/del&gt;C sous linux c&#039;est plus subtil.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Certes en C dans l&#039;environnement [[Arduino]] c&#039;est facile, un simple milis() donne le nombre de millisecondes depuis le boot&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. En &lt;/ins&gt;C sous linux c&#039;est plus subtil.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;En C standard on a une fonction dans &amp;lt;code&amp;gt;&amp;lt;time.h&amp;gt;&amp;lt;/code&amp;gt; qui fait le travail (et encore plus) : &amp;lt;code&amp;gt;clock_gettime&amp;lt;/code&amp;gt; dont la page de man est donnée : https://man7.org/linux/man-pages/man3/clock_gettime.3.html&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;En C standard on a une fonction dans &amp;lt;code&amp;gt;&amp;lt;time.h&amp;gt;&amp;lt;/code&amp;gt; qui fait le travail (et encore plus) : &amp;lt;code&amp;gt;clock_gettime&amp;lt;/code&amp;gt; dont la page de man est donnée : https://man7.org/linux/man-pages/man3/clock_gettime.3.html&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key knowledge:diff:1.41:old-1516:rev-1792:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Jpinon</name></author>
	</entry>
	<entry>
		<id>https://knowledge.pinon-hebert.fr/mediawiki/index.php?title=Temps_%C3%A0_la_milliseconde_en_C&amp;diff=1516&amp;oldid=prev</id>
		<title>Jpinon le 29 novembre 2025 à 22:42</title>
		<link rel="alternate" type="text/html" href="https://knowledge.pinon-hebert.fr/mediawiki/index.php?title=Temps_%C3%A0_la_milliseconde_en_C&amp;diff=1516&amp;oldid=prev"/>
		<updated>2025-11-29T22:42:49Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 29 novembre 2025 à 22:42&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l71&quot;&gt;Ligne 71 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 71 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Timestamp 1764455240.930000&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Timestamp 1764455240.930000&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Timestamp 1764455241.932000&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Timestamp 1764455241.932000&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;En &lt;/del&gt;moyenne on une mesure toutes les 1.004867 secondes. Si on considère que le sleep 1 est précis le reste de la boucle prends 4,8 ms. C&#039;est pas rapide la bash!&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Avec mon PC et WSL, en &lt;/ins&gt;moyenne on une mesure toutes les 1.004867 secondes. Si on considère que le sleep 1 est précis le reste de la boucle prends 4,8 ms. C&#039;est pas rapide la bash!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Avec mon PI4 c&#039;est plutôt 1.008867 secondes soit presque 9ms !&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Avec ma VM chez Gandi c&#039;est 1.014571 soit près de 15ms !&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vive l&#039;auto-hébergement sur Raspberry PI.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key knowledge:diff:1.41:old-1515:rev-1516:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Jpinon</name></author>
	</entry>
	<entry>
		<id>https://knowledge.pinon-hebert.fr/mediawiki/index.php?title=Temps_%C3%A0_la_milliseconde_en_C&amp;diff=1515&amp;oldid=prev</id>
		<title>Jpinon : Page créée avec « Autant en java ou en python gérer le temps en millisecondes est standard. En C c&#039;est pas si simple.   Certes en C dans l&#039;environnement Arduino c&#039;est facile, un simple milis() donne le nombre de millisecondes depuis le boot en C sous linux c&#039;est plus subtil.  En C standard on a une fonction dans &lt;code&gt;&lt;time.h&gt;&lt;/code&gt; qui fait le travail (et encore plus) : &lt;code&gt;clock_gettime&lt;/code&gt; dont la page de man est donnée : https://man7.org/linux/man-pages/man3/clock_... »</title>
		<link rel="alternate" type="text/html" href="https://knowledge.pinon-hebert.fr/mediawiki/index.php?title=Temps_%C3%A0_la_milliseconde_en_C&amp;diff=1515&amp;oldid=prev"/>
		<updated>2025-11-29T22:30:49Z</updated>

		<summary type="html">&lt;p&gt;Page créée avec « Autant en java ou en python gérer le temps en millisecondes est standard. En C c&amp;#039;est pas si simple.   Certes en C dans l&amp;#039;environnement &lt;a href=&quot;/Arduino&quot; title=&quot;Arduino&quot; data-bs-title=&quot;Arduino&quot;&gt;Arduino&lt;/a&gt; c&amp;#039;est facile, un simple milis() donne le nombre de millisecondes depuis le boot en C sous linux c&amp;#039;est plus subtil.  En C standard on a une fonction dans &amp;lt;code&amp;gt;&amp;lt;time.h&amp;gt;&amp;lt;/code&amp;gt; qui fait le travail (et encore plus) : &amp;lt;code&amp;gt;clock_gettime&amp;lt;/code&amp;gt; dont la page de man est donnée : https://man7.org/linux/man-pages/man3/clock_... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Autant en java ou en python gérer le temps en millisecondes est standard. En C c&amp;#039;est pas si simple. &lt;br /&gt;
&lt;br /&gt;
Certes en C dans l&amp;#039;environnement [[Arduino]] c&amp;#039;est facile, un simple milis() donne le nombre de millisecondes depuis le boot en C sous linux c&amp;#039;est plus subtil.&lt;br /&gt;
&lt;br /&gt;
En C standard on a une fonction dans &amp;lt;code&amp;gt;&amp;lt;time.h&amp;gt;&amp;lt;/code&amp;gt; qui fait le travail (et encore plus) : &amp;lt;code&amp;gt;clock_gettime&amp;lt;/code&amp;gt; dont la page de man est donnée : https://man7.org/linux/man-pages/man3/clock_gettime.3.html&lt;br /&gt;
&lt;br /&gt;
== clock_gettime ==&lt;br /&gt;
Cette fonction prends deux paramètres.&lt;br /&gt;
&lt;br /&gt;
* Une valeur constante donnant la façon de mesurer le temps : Dans notre cas &amp;lt;code&amp;gt;CLOCK_REALTIME&amp;lt;/code&amp;gt; est parfait. Ce n&amp;#039;est pas le plus rapide mais le plus précis.&lt;br /&gt;
* Un pointeur vers une structure &amp;lt;code&amp;gt;struct timespec&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/*The res and tp arguments are timespec structures, as specified in&lt;br /&gt;
  &amp;lt;time.h&amp;gt;:*/&lt;br /&gt;
&lt;br /&gt;
struct timespec {&lt;br /&gt;
    time_t   tv_sec;        /* Timestamp from EPOCH in seconds. like time()*/&lt;br /&gt;
    long     tv_nsec;       /* nanoseconds */&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Pour avoir une fonction qui donne le timestamp en millisecondes (le milis() d&amp;#039;Arduino) &amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
long long millis(void) {&lt;br /&gt;
    struct timespec ts;&lt;br /&gt;
    clock_gettime(CLOCK_REALTIME, &amp;amp;ts);&lt;br /&gt;
    return ((long long)ts.tv_sec * 1000) + (ts.tv_nsec / 1000000);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Logiquement il faut multiplier les secondes par 1000 pour avoir des millisecondes et diviser par 1000 les nanosecondes pour avoir des microsecondes puis encore par 1000 pour des millisecondes.&lt;br /&gt;
&lt;br /&gt;
== Exemple ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
/* File gettime.c*/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;time.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
long long millis(void) {&lt;br /&gt;
    struct timespec ts;&lt;br /&gt;
    clock_gettime(CLOCK_REALTIME, &amp;amp;ts);&lt;br /&gt;
    return ((long long)ts.tv_sec * 1000) + (ts.tv_nsec / 1000000);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main (){&lt;br /&gt;
    printf (&amp;quot;Timestamp %f\n&amp;quot;,millis()/1000.0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Imprime l&amp;#039;heure en secondes décimales (à la [[Python]]).&lt;br /&gt;
&lt;br /&gt;
On compile:&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cc -o gettime gettime.c&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;et on teste avec par exemple:&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
while [ 1 ]&lt;br /&gt;
do&lt;br /&gt;
  ./gettime&lt;br /&gt;
  sleep 1&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Qui me donne&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Timestamp 1764455226.859000&lt;br /&gt;
Timestamp 1764455227.864000&lt;br /&gt;
Timestamp 1764455228.872000&lt;br /&gt;
Timestamp 1764455229.882000&lt;br /&gt;
Timestamp 1764455230.888000&lt;br /&gt;
Timestamp 1764455231.891000&lt;br /&gt;
Timestamp 1764455232.895000&lt;br /&gt;
Timestamp 1764455233.899000&lt;br /&gt;
Timestamp 1764455234.907000&lt;br /&gt;
Timestamp 1764455235.913000&lt;br /&gt;
Timestamp 1764455236.917000&lt;br /&gt;
Timestamp 1764455237.920000&lt;br /&gt;
Timestamp 1764455238.923000&lt;br /&gt;
Timestamp 1764455239.927000&lt;br /&gt;
Timestamp 1764455240.930000&lt;br /&gt;
Timestamp 1764455241.932000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;En moyenne on une mesure toutes les 1.004867 secondes. Si on considère que le sleep 1 est précis le reste de la boucle prends 4,8 ms. C&amp;#039;est pas rapide la bash!&lt;/div&gt;</summary>
		<author><name>Jpinon</name></author>
	</entry>
</feed>