How to perform press and hold?

Hello,

I’ve a scenario in which i need to press and hold a button for five seconds.
I tried:
TouchAction action = new TouchAction(driver);
action.longPress(button).perform();

But it is not working for me. Please help me out.

new TouchAction(driver);
action.press().waitAction(5000).release().perform();