Feasibility of swim lap counter

I read an article, not sure where I found it (elektor magazine maybe?) that was Arduino based, used an accelerometer, maybe a gyro, mayye both, that started counting time when motion was sensed, counted laps when change of direction was sensed, and autopowered off when change of horizontal to vertical orientation was sensed.
Worm on the body with a belt, armband, something like that. Could be made very small with a custom board, add small screen for reading results, or uUSB for downloading.