Arduino unsigned long to Processing

I'm trying to use an Arduino with micros() to time how long it takes a signal to arrive. This generally seems to work with the serial monitor, but I've no (good) idea how to send that unsigned long to Processing in a way it can understand it. The low level representation of variables seems different between the languages, the serial print\read functions seem to be "helpfully" encoding things into characters.... and I'm fairly new to this to boot. Can anyone tell me where to start? If there's an example for this somewhere I can probably teach myself off of that, but as near as I can tell this isn't covered anywhere.

For further details: I won't be needing a full unsigned long for the time intervals I'm looking for, and would prefer to convert the difference to an int or something smaller like that to minimize serial traffic. I suppose I can also divide by 4 to save space if I need to as that's the lowest resolution micros() returns anyways.

PS: I find it sad that the spell checker on this forum doesn't recognize Arduino... I wonder if there's a way to add to it's dictionary.

but I've no (good) idea how to send that unsigned long to Processing in a way it can understand it.

How are you sending it? What problems are you having understanding it?

An unsigned long, even in microseconds covers a very long period (well over an hour) - are you sure your need that kind of precision?

You could send the values as ASCII decimal, or ASCII hex - whatever you're comfortable with.

"How are you sending it?" Currently with Serial.print

"What problems are you having understanding it?" When I use Serial.print to send a number in the Arduino serial monitor, it just works. When I try to read it in Processing, I think it's getting the correct "bits and bytes" but I'm struggling to figure out how to turn that back into my number as a usable variable (although all I've tried to do with it thus far is print it to the text area later I'll want to do math with it so I'd prefer not to convert it to a string... although I can't even get that to work yet). I think the serial link is generally working, as when I send a specific character, like "a", it comes out with the appropriate decimal ascii (#65) on processing. What makes it worse is that the numbers seem to be stored a bit differently between the arduino and processing, what with different # of bytes per int, ect. Also, generally speaking I've little experience with arudino\processing\serial so I am not sure that this is the best way to accomplish my goal. If you want me to I'll post my code I will but I would much prefer to try to find an example that shows a general correct way than try to fix all the issues with my cobbled together code.

"An unsigned long, even in microseconds covers a very long period (well over an hour) - are you sure your need that kind of precision?" I'm sure I don't, the unsigned long is just what micros() gives me. After I call it twice and find the difference the number is certainly no more than 30k and usually much less.

Thank you for trying to help a newbie.

When I use Serial.print to send a number in the Arduino serial monitor, it just works

OK, when you do this, Serial.print is converting the number to ASCII for you.
Note that it does NOT convert it to a string - a C/C++ string would have a zero to terminate it.

So, if you’re printing a value of, say 435, what is actually being transmitted over the serial link is the bytes 0x34 (52), 0x33 (51) and 0x35 (53).
The serial monitor sees these values and simply prints the characters ‘4’ ‘3’ ‘5’ (obviously, without the single quotes!).

Note that “Serial.print” doesn’t include any kind of terminator, so if you then “Serial.print (278)” after the first print, you’ll just see “435278” on the serial monitor.
If you use “serial.println” instead, you’ll see that 435 and 278 get printed on separate lines, because “println” also sends the characters carriage return (CR) and line-feed (LF) with the values 0x0d (13) and 0x0a (10) respectively after the number.
This makes things easier in Processing, because now you can detect the end of a number, form it into a string by tacking on a ‘\0’ (zero), and then using “atoi” to convert it into an integer for use in Processing.