implemented multithreading, but with mutex. will mit atomic operations optimieren

This commit is contained in:
any
2026-08-28 23:47:46 +02:00
parent 3d1cb713f2
commit 20ab33de33
5 changed files with 93 additions and 27 deletions
+7 -1
View File
@@ -9,6 +9,8 @@
#include <stdlib.h>
#include "interface.h"
#include "helper.h"
#include <time.h>
#include <stdio.h>
void example_color(int width, int height, int channels, unsigned char **image) {
for (int i = 0; i < height * width; i++) {
@@ -113,7 +115,11 @@ void exampleCornell( int width, int height, int channels, unsigned char **image)
objectList[18] = (object){1, &(makroObj3.quad6), 0};
clock_t startTime = clock();
displaySzene(objectList, objectCount, cam1, width, height, channels, image);
clock_t endTime = clock();
double elapsedTime = (endTime - startTime)/(double)CLOCKS_PER_SEC;
printf("%.3lf\n", elapsedTime);
}