Joint RIS-Assisted Localization and Communication: A Trade-off Among Accuracy, Spectrum Efficiency, and Time Resource