Skip to content

Instantly share code, notes, and snippets.

@mumblepins
Created August 12, 2014 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mumblepins/e141962fa063a57d4def to your computer and use it in GitHub Desktop.
Save mumblepins/e141962fa063a57d4def to your computer and use it in GitHub Desktop.
void setup() {
Serial.begin(115200);
while (!Serial.available()) SPARK_WLAN_Loop();
}
double avgDelay;
double totalDelay;
unsigned long timer1;
unsigned long timer2;
int count=0;
void loop() {
count++;
timer1=micros();
Spark.publish("This is a test","of the spark publish function");
timer2=micros();
totalDelay+=timer2-timer1;
avgDelay=totalDelay/(double)count;
Serial.print(timer2-timer1);
Serial.print(" ");
Serial.println(avgDelay);
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment