// Ex13_05.cpp : Defines the entry point for the application.
// Using a task group
#include "stdafx.h"
#include "Resource.h"
#include "Fushu.h"
#include "ppl.h"
#include <functional>
//#include "HRTimer.h"
#include "commctrl.h" // For the status bar
#include <string>
#include <sstream>
#include <OleCtl.h>
class HRTimer
{
public:
HRTimer(void) : frequency(1.0 / GetFrequency()) { }
double GetFrequency(void)
{
LARGE_INTEGER proc_freq;
::QueryPerformanceFrequency(&proc_freq);
return static_cast<double>(proc_freq.QuadPart);
}
void StartTimer(void)
{
DWORD_PTR oldmask = ::SetThreadAffinityMask(::GetCurrentThread(), 0);
::QueryPerformanceCounter(&start);
::SetThreadAffinityMask(::GetCurrentThread(), oldmask);
}
double StopTimer(void)
{
DWORD_PTR oldmask = ::SetThreadAffinityMask(::GetCurrentThread(), 0);
::QueryPerformanceCounter(&stop);
::SetThreadAffinityMask(::GetCurrentThread(), oldmask);
return ((stop.QuadPart - start.QuadPart) * frequency);
}
private:
LARGE_INTEGER start;
LARGE_INTEGER stop;
double frequency;
};
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hInst; // current instance
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name
const size_t MaxIterations(8000); // Maximum iterations before infinity
HRTimer timer; // Timer object to calculate processor time
bool parallel(false); // True for parallel execution
// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
// Using a task group
#include "stdafx.h"
#include "Resource.h"
#include "Fushu.h"
#include "ppl.h"
#include <functional>
//#include "HRTimer.h"
#include "commctrl.h" // For the status bar
#include <string>
#include <sstream>
#include <OleCtl.h>
class HRTimer
{
public:
HRTimer(void) : frequency(1.0 / GetFrequency()) { }
double GetFrequency(void)
{
LARGE_INTEGER proc_freq;
::QueryPerformanceFrequency(&proc_freq);
return static_cast<double>(proc_freq.QuadPart);
}
void StartTimer(void)
{
DWORD_PTR oldmask = ::SetThreadAffinityMask(::GetCurrentThread(), 0);
::QueryPerformanceCounter(&start);
::SetThreadAffinityMask(::GetCurrentThread(), oldmask);
}
double StopTimer(void)
{
DWORD_PTR oldmask = ::SetThreadAffinityMask(::GetCurrentThread(), 0);
::QueryPerformanceCounter(&stop);
::SetThreadAffinityMask(::GetCurrentThread(), oldmask);
return ((stop.QuadPart - start.QuadPart) * frequency);
}
private:
LARGE_INTEGER start;
LARGE_INTEGER stop;
double frequency;
};
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hInst; // current instance
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name
const size_t MaxIterations(8000); // Maximum iterations before infinity
HRTimer timer; // Timer object to calculate processor time
bool parallel(false); // True for parallel execution
// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);










