Get screen timeout

is it possible to get screen timeout? i meen to get it when screen is going dark