This one published in 1995?
Identical twins Barry and Harry Krasner are house-sitting at their great-uncle's Midwest farm. It's peaceful at first, but soon they realize there's something about the farmhouse that makes locals stay far away. The twins are sure that the locked shed out back is their reason why – but what they find there is more shocking than anything they could have imagined.
From a review: "I'll summarize the plot quickly. Barry and Harry are twins, but Barry is strong and popular, and he bullies Harry, who is weak. Harry, eventually getting fed up, locks himself inside a room that holds a singularity, where time flies inside the room while time slows to a crawl outside. He keeps himself in the room for a year while a night passes on the outside world.
The best part of
Singularity was not the psychological rivalry between the twins, but how Harry managed to keep himself sane through a regimented routine of diet, exercise, meditation and reading. I found it very interesting how someone could find inner peace, and grow up to be a man, through such a regimented, solitary program."
Amazon.com: Singularity (9780140375985): William Sleator: Books