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 279 278
root@james-desktop:/opt/Marvell_test/sleep_test#cat /proc/sys/kernel/sched_latency_ns
5000000
5ms
/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 10542 10541
/tmp # cat /proc/sys/kernel/sched_
/tmp # cat /proc/sys/kernel/sched_latency_ns
20000000
20ms