title: How can i create a multithread in C for windows?
body: <p>I dont know how can I make threads in C, i saw a review about pthread.h library but then i heard that its only for Linux OS, i have a function that its a timer, i want to created a thread with that function but i dont know either the library i need to use and syntax's to write the code, if someone could provide me a simple code with threads, or tell me what things i need to put and the parameter of the functions.</p>
  
  <p>Here its the function i create that countdown the specific time the user apply:
  i need to make a thread with that function.</p>
  
  <p>Function (Countdown):</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;time.h&gt;
  
  void countdown(int second)
  {
      int secs = 1;
      time_t unix;
      struct tm * timeinfo;
      time(&amp;unix);
      timeinfo = localtime(&amp;unix);
      int t1 = timeinfo-&gt;tm_sec;
      int t2 = timeinfo-&gt;tm_sec;
      int i = 0;
  
      while(1 == 1)
      {
         time(&amp;unix);
         timeinfo = localtime(&amp;unix);
         if((t1 + i)  == timeinfo-&gt;tm_sec)
         {
                system("cls");
                printf("Time left %d\n", timeinfo-&gt;tm_sec - t2 - second);
                i++;
         }
         if(timeinfo-&gt;tm_sec &gt;= (t1 + second))
         {
             system("cls");
             puts("Your time its done");
             break;
         }
  
      }
  }
  
  int main()
  {
      int limit;
      printf("How much time would you like (In secs): ");
      scanf("%d", &amp;limit);
      countdown(limit);
  
      system("PAUSE");
      return 0;
  }
  </code></pre>