How to change the analog sample rate?

Hello, everyone
I am new bird. I don't know how to change the analog sample rate.

for example, I want to change the analog sample rate to 1K Hz, how to do this ?

Thank you very much!!

Sample every millisecond in your code?

lihuanyu1024:
I want to change the analog sample rate to 1K Hz, how to do this ?

What rate is it sampling at now?

Post your program if you need help - that way we can see what you can see.
And please use the code button </>so your code looks like thisand is easy to copy to a text editor

…R

unsigned long currentMicros;
unsigned long previousMicros;
unsigned long elapsedMicros;
unsigned long duration = 1000; //   1 over 1000 = 1mS or 1000uS
unsigned int analogValue;
void setup(){
}
void loop(){
// set up for "blink without delay", but in this case periodic analog reads
currentMicros = micros(); // what 'time' is it now?
elapsedMicros = currentMicros - previousMicros; //  determine how much 'time' has gone by
  if (elapsedMicros >= duration){ // has enough, or more than enough gone by?
  previousMicros = previousMicros + duration; // set up next sample time
  analogValue = analogRead(A0); // A0 to A5 on Uno, take a measurement
  // and do what with it??
  }
// do other stuff while time passes by
}