Professional Documents
Culture Documents
лб8
лб8
Лабораторна робота №8
з дисципліни:
«Операційні системи»
Виконав:
Маркевич Адам
Тернопіль – 2022
ЛАБОРАТОРНА №8
ЗАВДАННЯ
2. Новий процес за допомогою функції ctime() друкує поточну дату узручній для
користувача формі.
ХІД РОБОТИ
1) #include <cstdlib>
#include <iostream>
int main() {
system("hostname");
return 0;
}
2) #include <iostream>
#include <thread>
#include <chrono>
#include <ctime>
void printCurrentDate() {
while (true) {
time_t currentTime = time(nullptr);
string currentDate = ctime(¤tTime);
int main() {
thread currentDateThread(printCurrentDate);
currentDateThread.join();
return 0;
}