first commit!

This commit is contained in:
2025-02-06 12:54:34 +02:00
commit 37f9a3d138
24 changed files with 693 additions and 0 deletions

22
register.c Normal file
View File

@ -0,0 +1,22 @@
#include <stdio.h>
#include <time.h>
int main() {
struct timespec t0, t1;
long int i = 0;
register long int x = 0;
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t0);
for (; i < 1000; ++i)
printf("%ld ", i + 1);
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t1);
printf("\n%ldns took usual var", (t1.tv_sec - t0.tv_sec) * (long)1e9 + (t1.tv_nsec - t0.tv_nsec));
printf("\n\n");
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t0);
for (; x < 1000; ++x)
printf("%ld ", x + 1);
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &t1);
printf("\n%ldns took register var", (t1.tv_sec - t0.tv_sec) * (long)1e9 + (t1.tv_nsec - t0.tv_nsec));
}