Http://blog.chinaunix.net/space.php? Uid = 488742 & Do = Blog & cuid = 1276208
Root @ James-desktop:/opt/marvell_test/sleep_test #./x86_test_sleep
Function time (USEC) realtime reduce
-------------------------------------------------------------------
Usleep 500000 500640 640
Nanosleep 500000 500998 998
Select 500000 500929 929
Usleep 100000 101256 1256
Nanosleep 100000 100715 715
Select 100000 100887 887
Usleep 50000 51001 1001
Nanosleep 50000 51049 1049
Select 50000 50919 919
Usleep 20000 20948 948
Nanosleep 20000 20971 971
Select 20000 20976 976
Usleep 10000 10973 973
Nanosleep 10000 10972 972
Select 10000 10973 973
Usleep 5000 5984 984
Nanosleep 5000 5099 99
Select 5000 5826 826
Usleep 2000 3015 1015
Nanosleep 2000 2992 992
Select 2000 2970 970
Usleep 1000 1935 935
Nanosleep 1000 1991 991
Select 1000 1989 989
Usleep 800 1018 218
Nanosleep 800 1023 223
Select 800 929 129
Usleep 500 948 448
Nanosleep 500 946 446
Select 500 1003 503
Usleep 100 969 869
Nanosleep 100 1052 952
Select 100 280 180
Usleep 10 243 233
Nanosleep 10 359 349
Select 10 1011 1001
Usleep 1 956 955
Nanosleep 1 1006 1005
Select 1 1 279 278
Root @ James-desktop:/opt/marvell_test/sleep_test # Cat/proc/sys/kernel/sched_latency_ns
5000000
5 ms
/Tmp #./test_sleep
Function time (USEC) realtime reduce
-------------------------------------------------------------------
Usleep 500000 507853 7853
Nanosleep 500000 509887 9887
Select 500000 509971 9971
Usleep 100000 109963 9963
Nanosleep 100000 109976 9976
Select 100000 109960 9960
Usleep 50000 59973 9973
Nanosleep 50000 59975 9975
Select 50000 59980 9980
Usleep 30000 39976 9976
Nanosleep 30000 39971 9971
Select 30000 39978 9978
Usleep 20000 29976 9976
Nanosleep 20000 29975 9975
Select 20000 29976 9976
Usleep 10000 19976 9976
Nanosleep 10000 19977 9977
Select 10000 20048 10048
Usleep 5000 9907 4907
Nanosleep 5000 9977 4977
Select 5000 9980 4980
Usleep 2000 9974 7974
Nanosleep 2000 9977 7977
Select 2000 9979 7979
Usleep 1000 9973 8973
Nanosleep 1000 9976 8976
Select 1000 9979 8979
Usleep 800 10044 9244
Nanosleep 800 9905 9105
Select 800 9978 9178
Usleep 500 9976 9476
Nanosleep 500 9977 9477
Select 500 9979 9479
Usleep 100 9977 9877
Nanosleep 100 9976 9876
Select 100 9977 9877
Usleep 10 9975 9965
Nanosleep 10 10053 10043
Select 10 9902 9892
Usleep 1 9975 9974
Nanosleep 1 9977 9976
Select 1 1 10542 10541
/Tmp # Cat/proc/sys/kernel/sched _
/Tmp # Cat/proc/sys/kernel/sched_latency_ns
20000000
20 ms