I have to make a tool like those 'online judges', to compile and execute c/cpp code and return some results, but also measure if it exceeds time limit or a memory limit.
I found multiple linux commands that use a process's PID, and i was able to get the pid of the process after i start the executable, but the process would finish before those linux commands that read memory usage, and so it would throw an error.
I also found valgrind, but it takes too much time to finish.
Is there a way to start an executable resultet from a given c/cpp file, and make it not end until i tell it to, so that i have time to read its memory usage???
A bash/cpp/c solution thkx.