The Doze app was created for people without Marshmallow, it does something similar but I got mixed results when I tried it. The Doze feature is baked into Marshmallow core so it is far more reliable, the only downside is that it needs your phone completely in sleep mode without any sensor triggered in order to get activated.