title: Convert milliseconds to timespec for GNU port
body: <p>I want to convert milliseconds into timespec structure used by GNU Linux. I have tried following code for the same.</p>
  
  <pre><code>  timespec GetTimeSpecValue(unsigned long milisec)
    {
      struct timespec req;
      //long sec = (milisecondtime /1000);
      time_t sec = (time_t)(milisec/1000);
      req-&gt;tv_sec = sec;
      req-&gt;tv_nsec = 0;
      return req;
    }
  </code></pre>
  
  <p>Running this code gives me the following error.</p>
  
  <blockquote>
    <p>expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘GetTimeSpecValue’</p>
  </blockquote>
  
  <p>I have also include <strong>time.h</strong> file in the code.</p>