Cardiovascular diseases, such as heart attack and congestive heart failure, are the leading cause of death both in the United States and worldwide. The current medical practice for diagnosing cardiovascular diseases is not suitable for long-term, out-of-hospital use. A key to long-term monitoring is the ability to detect abnormal cardiac rhythms, i.e., arrhythmia, in real-time. In this paper, we present our work in designing real-time sensing, and evaluating machine learning algorithms for real-time arrhythmia detection. Most of the existing work applies machine learning algorithms to electrocardiogram (ECG) images to detect abnormal patterns. These approaches are not suitable for real-time processing due to high processing overhead. In our work, we treat data as time series, and evaluate various machine learning algorithms in terms of both learning and computational performance. Our experimental results show that the long short-term memory network (LSTM) has both high accuracy and efficiency, demonstrating great potential for online detection of arrhythmia.