我正在尝试构建一个需要 2 个时间戳的程序:第一个进程结束时的时间戳,然后是第二个进程开始时的时间戳。然后求两者的差值。
但我无法编译,因为链接器抱怨clock_gettime,给出了未定义的符号错误。
gcc (GCC) 3.2.1
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Run Code Online (Sandbox Code Playgroud)
gcc (GCC) 3.2.1
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Run Code Online (Sandbox Code Playgroud)
这是编译器(链接器)错误:
gcc -Wall -o time ./time.c …Run Code Online (Sandbox Code Playgroud)