mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-13 20:12:26 +00:00
17 lines
351 B
C++
17 lines
351 B
C++
// Count to infinity sleeping one second per number.
|
|
//
|
|
// https://cirosantilli.com/linux-kernel-module-cheat#cpp-multithreading
|
|
|
|
#include <chrono>
|
|
#include <thread>
|
|
#include <iostream>
|
|
|
|
int main() {
|
|
int i = 0;
|
|
while (1) {
|
|
std::cout << i << std::endl;
|
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
i++;
|
|
}
|
|
}
|