get the time under ubuntu storage size

前端 未结 2 1879
滥情空心
滥情空心 2021-01-26 18:13

I\'m writing a program in C-language which its a simulation program for one barbershop one chair model under Ubuntu 13.04 environment .

I have a timer () function which

相关标签:
2条回答
  • 2021-01-26 18:33

    You seem to be trying to run MS-DOS / Turbo-C code on Linux?

    There's no struct time and gettime() function in the Unix C library, you're probably looking for struct tm and localtime() instead, see e.g.:

    http://www.tutorialspoint.com/c_standard_library/c_function_localtime.htm

    0 讨论(0)
  • 2021-01-26 18:38

    If you are on ubuntu, you can just do:

    srand(time(NULL));
    

    You don't need your own timer() function. If you need more fine resolution than 1 second, look into gettimeofday.

    0 讨论(0)
提交回复
热议问题