OS X 10.11.5 hangs occasionally for 30 seconds for multitasking, gestures and the Dock
Don't worry, it's not just you. Many Mac users are experiencing this same issue, including me. It is thought to be a bug in 10.11.4 and I suggest you upgrade to 10.11.5 or downgrade (if you have a backup) to 10.11.3.

In my case, I haven't had an issue or a freeze since I upgraded to 10.11.5. It works great.

See: http://www.macrumors.com/2016/05/13/macbook-pro-system-freezes-os-x-10-11-4/