pub fn pid() -> u32
This process’s id; 0 on the web, which has no processes (std::process::id panics there).
std::process::id