I am improving the tool. Please note that this tool will be associated with a test program that will have a function main( ), so my tool cannot be the main one. This tool has a number of functions that the test program will use.
Now, in addition, I want to add a timer to this tool. The idea is this: when a test program is connected to this tool and starts, the timer should start automatically.
If it were C ++, I would create a class with a constructor, so whenever a class loads, the constructor is called first, and I can initialize my timer inside the constructor.
If it was Java, I would just create a global static block and put the timer code inside the static block.
But my tool is purely in C on Linux, so how can I achieve this?
Please help me.
source
share