Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace app {
- void test_thread(void*) {
- int n = sizeof(array_for_sort)/sizeof(array_for_sort[0]);
- int pmin, i, j=0;
- dbprintf("rozpoczynam sortowanie dla %d elementow\n", n);
- auto totaltime = isix::get_ujiffies();
- while(j<n)
- {
- pmin = j;
- i = j+1;
- while(i < n)
- {
- if(array_for_sort[i] < array_for_sort[pmin])
- pmin=i;
- dbprintf("%d", i);
- i++;
- }
- int auxvar = array_for_sort[j];
- array_for_sort[j] = array_for_sort[pmin];
- array_for_sort[pmin] = auxvar;
- j++;
- }
- totaltime = totaltime - isix::get_ujiffies();
- dbprintf("Koniec, czas: %d\n", totaltime);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement