Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "Windows.h"
- using namespace std;
- int main(){
- int x = 0;
- for (int i=0; i<100000; i++){ //pretend main loop
- #pragma omp parallel for schedule(dynamic,50) reduction(+ : x)
- for (int p=0; p<10000; p++){
- x++;
- }
- cout << "X = " << x << "\nNow sleeping for 50ms.\n";
- Sleep(50);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement