Skip to content

meta-42/MultithreadingTask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MultithreadingTask

Multithreading task controller

auto dis = GContext->taskDispatcher;

for (int i = 0; i < 1000; i++)
{
	dis->PushTask(new TestTask(1.f, 0.f, 2.f));
}



double dur;
clock_t start, end;
start = clock();

dis->Flush();
dis->Wait();

end = clock();
dur = (double)(end - start);
printf("Use Time:%f\n", (dur / CLOCKS_PER_SEC));

Sleep(2000);
dis->PushTask(new TestTask(1.f, 0.f, 2.f));
dis->PushTask(new TestTask(1.f, 0.f, 2.f));
dis->PushTask(new TestTask(1.f, 0.f, 2.f));
dis->PushTask(new TestTask(1.f, 0.f, 2.f));
dis->PushTask(new TestTask(1.f, 0.f, 2.f));
dis->Flush();
dis->Wait();

About

Multithreading task controller

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages