2014-09-02 11 views
7

Sto usando MSVS 2006 e sto cercando di trovare il tempo in microsecondi nel mio programma. Provo a chiamare sys/time.h nell'intestazione ma questo errore è compilato.Come usare sys/time.h nella finestra?

fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory 
Error executing cl.exe. 

e questo è il mio codice,

#include<sys/time.h> 
#include<stdio.h> 
int main() 
{ 
    struc timeval stop,start; 
    gettimeofday(&start,NULL); 

    /*my function here*/ 

    gettimeofday(&stop,NULL); 
    printf("took %lu usec\n",stop.tv_usec-start.tv_usec); 
} 
+0

Mazaya-Jamil, ti invitiamo a condividere cui soluzione ha funzionato per voi? – Bear

+0

C'è sys \ timeb.h – BlenderBender

risposta

Problemi correlati