So I was curious how long the various Spark.* cloud calls take, and thought that other people may be interested as well. I wrote a quick script to test the time for the Spark.publish function, and in general I was seeing an average of around 470 µs. This seems to be connection dependent however, as when I mess with the connection by hammering my internet connection with other data, the times sometimes jump up to a second or so.
I’m not entirely sure of the best way to test Spark.variable. I wrote this bit to monitor the times outside of the loop() function, because it’s my understanding that the updates to the cloud occur outside the loop. With this I’m seeing a pretty consistent time of about 2000-5000 µs, with no change when a call to the API is made. I also don’t see a change within the loop either, it’s pretty consistently ~1000 µs+ 1s delay. If someone has a better way to test this, I’m all ears.
I didn’t bother trying to test Spark.function, as it would seem to me to be highly dependent on what the function does.