Complex cyber–physical systems interact in real time and must consider both timing and uncertainty. Developing software for such systems is expensive and difficult, especially when modeling, inference, and real-time behavior must be developed from scratch. In the last decade, a popular general probabilistic modeling paradigm has emerged – called probabilistic programming languages (PPLs) – that simplifies modeling and inference by separating the concerns between probabilistic modeling and inference algorithm implementation. However, these languages have primarily been designed for offline problems, not online real-time systems. In this paper, we combine PPLs and real-time programming primitives by introducing the concept of real-time probabilistic programming languages (RTPPL). We develop an RTPPL called ProbTime and a new approach for fairness-guided optimization of inference accuracy of a ProbTime system under schedulability constraints. Moreover, we illustrate the applicability of ProbTime on an automotive testbed performing indoor positioning and braking.