Forking & Threading.
All checks were successful
isspam build / build (push) Successful in 1m54s

This commit is contained in:
retoor 2024-12-01 22:32:23 +01:00
parent 0b21d119af
commit c26927a265
3 changed files with 5 additions and 3 deletions

View File

@ -6,6 +6,6 @@ time_start = time.time()
subprocess.check_output('./isspam books/*.txt', shell=True)
print("Time C:",time.time() - time_start)
time_start = time.time()
subprocess.check_output('./risspam books/*.txt', shell=True)
subprocess.check_output('./risspam -p books/*.txt', shell=True)
print("Time Rust:",time.time() - time_start)
print("***end benchmark***")

BIN
isspam

Binary file not shown.

View File

@ -313,12 +313,14 @@ int main(int argc, char *argv[]) {
if (argc > 1) {
for (int i = 1; i < argc; i++) {
pid_t pid = fork();
if(!pid){
printf("File: %s\n", argv[i]);
analyze_file(argv[i]);
printf("\n");
return 0;
}
}
return 0;