"Fossies" - the Fresh Open Source Software Archive

Member "FunctionCheck-3.2.0/test/simple_test_calib.c" (26 May 2012, 489 Bytes) of package /linux/privat/old/FunctionCheck-3.2.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #include <stdio.h>
    2 #include <stdlib.h>
    3 #include <unistd.h>
    4 
    5 /* simple test with calibrated time spend in each function */
    6 
    7 void lo1()
    8 {
    9     sleep(1);
   10 }
   11 
   12 void lo2()
   13 {
   14     sleep(2);
   15 }
   16 
   17 void lo3()
   18 {
   19     sleep(3);
   20 }
   21 
   22 void lo1to2()
   23 {
   24     sleep(1);
   25     lo1();
   26 }
   27 
   28 void lo3to6()
   29 {
   30     sleep(3);
   31     lo3();
   32 }
   33 
   34 void rec(int n)
   35 {
   36     sleep(1);
   37     if (n > 0)
   38         rec(n - 1);
   39 }
   40 
   41 int main(int argc, char *argv[])
   42 {
   43     lo1();
   44 
   45     lo2();
   46 
   47     lo1to2();
   48 
   49     lo3to6();
   50 
   51     rec(5);
   52 
   53     return 0;
   54 }