Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ctime>
- #include <unistd.h>
- #include <fstream>
- using namespace std;
- int main()
- {
- ofstream fout;
- fout.open("lab-next.txt");
- char buffer[80];
- time_t seconds;
- tm* timeinfo;
- char* format = "%H:%M:%S";
- int pid = getpid();
- execl("./lab-next-d1", "lab-next-d1", NULL, (char*)0);
- execl("./lab-next-d2", "lab-next-d2", NULL, (char*)0);
- execl("./lab-next-d3", "lab-next-d3", NULL, (char*)0);
- for (int k=0; k<=100; k++) {
- seconds = time (NULL);
- timeinfo = localtime (&seconds);
- strftime(buffer, 80, format, timeinfo);
- fout << k << " " << pid << " " << buffer << "\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment