Author Topic: How to measure milli seconds  (Read 5085 times)

0 Members and 1 Guest are viewing this topic.

David HK

  • Hero Member
  • *****
  • Posts: 509
  • Country: hk
How to measure milli seconds
« on: January 12, 2011, 02:17:11 AM »
Does anyone have details of any Internet available programme that can measure the time taken between the pressing of a keys on a numeric pad?

Hardware ideas would be useful.

The key pad generates a key-press-acknowledgement beep so time between beep 1 and the beep 2 is what I am looking for.

Regards,

David in HK

rossw

  • Hero Member
  • *****
  • Posts: 834
  • Country: au
Re: How to measure milli seconds
« Reply #1 on: January 12, 2011, 02:59:15 AM »
Does anyone have details of any Internet available programme that can measure the time taken between the pressing of a keys on a numeric pad?

Hardware ideas would be useful.

The key pad generates a key-press-acknowledgement beep so time between beep 1 and the beep 2 is what I am looking for.

Pretty open-ended request.

Most of the microsloth stuff has a pretty low system clock, so precision will be a problem using ticks.
Are the keypresses *DOING* anything or are they purely your "input" device?

I routinely measure the time between ethernet *packets* to microsecond accuracy in unix environments, probably something exists in the microsoft world too. It then becomes a question of: can you trigger some event from the keypad?

How far apart are these presses?   Measuring 5 seconds +/- 1mS is a very different task to measuring a few milliseconds.

If you want to build hardware, millisecond timing in seconds is trivial. (30 years ago, we were measuring flight-times of bullets over 600 metres, with resolution below 10 nanoseconds - but that took some non-trivial hardware).

Most $5 PIC chips can do interval timing to sub-millisecond without breaking into a sweat - a PICAXE chip could do it in a couple of lines of basic, and send you the answer via RS232.

So... more information might help narrow your list of options :)

DamonHD

  • Super Hero Member Plus
  • *******
  • Posts: 4130
  • Country: gb
    • Earth Notes
Re: How to measure milli seconds
« Reply #2 on: January 12, 2011, 03:01:42 AM »
It's going to depend very largely on the keyboard hardware (eg does it queue up keystrokes and send them to the OS on a regular basis after debouncing).  You might even be able to set up the keyboard or drivers to do what you want automatically from the command-line or some pointy-clicky config screens.

If I were writing code on Windows I'd try using the multimedia timer and/or looking at timestamps on incoming keyboard events if its a GUI app.

If writing in Java I'd use System.currentTimeMills() and/or looking at timestamps on incoming keyboard events if its a Swing/AWT app.

Rgds

Damon
Podcast: https://www.earth.org.uk/SECTION_podcast.html

@DamonHD@mastodon.social

David HK

  • Hero Member
  • *****
  • Posts: 509
  • Country: hk
Re: How to measure milli seconds
« Reply #3 on: January 12, 2011, 04:15:06 AM »
Thanks chaps. I will try to be more clear.

Numeric keypad - I press six numbers and as each one is pressed a key press acknowledgement beep sounds. I want to record the six beeps in an audio file on a lap top computer.

I then want to work out the milli-second spacing between the six audio beeps.

What free ware can I use to do this?

Regards

David in HK

David HK

  • Hero Member
  • *****
  • Posts: 509
  • Country: hk
Re: How to measure milli seconds
« Reply #4 on: January 12, 2011, 04:19:27 AM »
How far are the beeps apart?

How quickly or slowly can you move your finger from 2 to 7 on the key pad or any set of numbers you choose? Idnentical numbers in succession - say 88 - will have a very quick move between them. I wonder if they would go into nano second range?

Regards,

David


rossw

  • Hero Member
  • *****
  • Posts: 834
  • Country: au
Re: How to measure milli seconds
« Reply #5 on: January 12, 2011, 04:31:02 AM »
Numeric keypad - I press six numbers and as each one is pressed a key press acknowledgement beep sounds. I want to record the six beeps in an audio file on a lap top computer.

I then want to work out the milli-second spacing between the six audio beeps.

What free ware can I use to do this?

Get yourself a copy of Audacity. I think it's available for PC too.
It lets you record easily, and will let you then edit the file in great detail. It does millisecond-accurate timecodes, you can identify the start or peak of one audio "click", and time to the next. The inter-click-duration is directly read out on the display.

Or did you mean you need something to do this automatically and output to some file somewhere?

It's really hard with only 10% of the story....

Madscientist267

  • Hero Member
  • *****
  • Posts: 1181
  • Country: us
  • Uh oh. Now what have I done?
Re: How to measure milli seconds
« Reply #6 on: January 12, 2011, 04:32:12 AM »
Why handicap thy self? :

(M)ost (I)ntelligent (C)ustomers (R)ealize (O)ur (S)oftware (O)nly (F)ools (T)eenagers

(W)hen (I)ndustry (N)eglects (D)istribution (O)f (W)orking (S)oftware, (X)perts (P)irate

or, they just zero it and install Linux...

Sorry. Felt compelled.  ;D

Steve

« Last Edit: January 12, 2011, 04:35:30 AM by Madscientist267 »
The size of the project matters not.
How much magic smoke it contains does !

rossw

  • Hero Member
  • *****
  • Posts: 834
  • Country: au
Re: How to measure milli seconds
« Reply #7 on: January 12, 2011, 04:38:12 AM »
How quickly or slowly can you move your finger from 2 to 7 on the key pad or any set of numbers you choose? Idnentical numbers in succession - say 88 - will have a very quick move between them. I wonder if they would go into nano second range?

I can *GUARANTEE* no human can do *ANYTHING* in nanoseconds. Do you know how quick they are???

1000 milliseconds = 1 second
1000 microseconds = 1 millisecond
1000 nanoseconds  1 microsecond.

I used to be able to send morse code at >50 WPM. That's 250 characters/minute, or 4/second. And that's pretty darn fast.
Even at that, and lets take a typical character as 3 bits, thats "around" 80 milliseconds per bit. I'm no superman, but even if someone could manage 80 TIMES FASTER THAN THAT (not a chance! The world record is still only a whisker over 75 WPM) - that would be only ONE MILLION TIMES SLOWER than would be required for nanosecond timing :)

David HK

  • Hero Member
  • *****
  • Posts: 509
  • Country: hk
Re: How to measure milli seconds
« Reply #8 on: January 12, 2011, 06:02:34 AM »
Ross and all the other helpers,

Thank you for your replies, it looks like Audacity might do the trick.

Also thank you for the humour in your comments which has allowed me to have a pleasant chuckle despite the outside temperature being down to 5 degrees Celsius.

Thank you.

Regards,

David in Hong Kong

SparWeb

  • Global Moderator
  • Super Hero Member Plus
  • *****
  • Posts: 5448
  • Country: ca
    • Wind Turbine Project Field Notes
Re: How to measure milli seconds
« Reply #9 on: January 12, 2011, 02:41:49 PM »
Thank you, too, David, for the chuckle you gave me.

"...5 degrees Celsius..."


He probably means 5 above zero, too-

 >:(
No one believes the theory except the one who developed it. Everyone believes the experiment except the one who ran it.
System spec: 135w BP multicrystalline panels, Xantrex C40, DIY 10ft (3m) diameter wind turbine, Tri-Star TS60, 800AH x 24V AGM Battery, Xantrex SW4024
www.sparweb.ca

Bruce S

  • Global Moderator
  • Super Hero Member Plus
  • *****
  • Posts: 5422
  • Country: us
  • USA
Re: How to measure milli seconds
« Reply #10 on: January 12, 2011, 04:33:09 PM »
Thank you, too, David, for the chuckle you gave me.

"...5 degrees Celsius..."


He probably means 5 above zero, too-

 >:(
For Hong Kong 5C (41F) would be pretty cold. Kinda like S. Carolina getting snow about now  :P

Only place both meet is -40!!
Cheers
Bruce S
A kind word often goes unsaid BUT never goes unheard

wooferhound

  • SuperHero Member
  • ******
  • Posts: 2288
  • Country: us
  • Huntsville Alabama U.S.A.
    • Woofer Hound Sound & Lighting Rentals
Re: How to measure milli seconds
« Reply #11 on: January 12, 2011, 05:28:35 PM »
A nanosecond is a really small amount of time
to give you some perspective
A nanoyear (one billionth of a year) is 0.0315 seconds, or 31.5 milliseconds