Repository: GuillaumeGomez/sysinfo (language: rust)

Issue:
Windows CPU frequency does not refresh
**Describe the bug**
When retrieving the frequency in windows, it only retrieves it once and then never again refreshes it, even if the refresh flag is used. Looking through the code, there is a boolean that is used to retrieve the frequency just once (not sure the reason for this):
```rust
pub fn get_frequencies(&mut self) {
    if self.got_cpu_frequency {
        return;
    }
    let frequencies = get_frequencies(self.cpus.len());

    for (cpu, frequency) in self.cpus.iter_mut().zip(frequencies) {
        cpu.inner.set_frequency(frequency);
    }
    self.got_cpu_frequency = true;
}
```
I can do a PR and fix this if it's a bug.

**To Reproduce**
```rust
fn main() {
    let mut sys = sysinfo::System::new_all();
    loop {
        sys.refresh_cpu_frequency();
        dbg!(sys
            .cpus()
            .iter()
            .map(|el| el.frequency())
            .collect::<Vec<_>>());
        std::thread::sleep(std::time::Duration::from_secs(1));
    }
}
``` 


Discussion / hints:
It definitely sounds like a bug so a PR is very welcome.

Fix patch:
diff --git a/src/windows/cpu.rs b/src/windows/cpu.rs
index 5ad36ea9e..e84f1b429 100644
--- a/src/windows/cpu.rs
+++ b/src/windows/cpu.rs
@@ -250,7 +250,6 @@ impl Query {
 pub(crate) struct CpusWrapper {
     pub(crate) global: CpuUsage,
     cpus: Vec<Cpu>,
-    got_cpu_frequency: bool,
 }
 
 impl CpusWrapper {
@@ -261,7 +260,6 @@ impl CpusWrapper {
                 key_used: None,
             },
             cpus: Vec::new(),
-            got_cpu_frequency: false,
         }
     }
 
@@ -276,7 +274,6 @@ impl CpusWrapper {
     fn init_if_needed(&mut self, refresh_kind: CpuRefreshKind) {
         if self.cpus.is_empty() {
             self.cpus = init_cpus(refresh_kind);
-            self.got_cpu_frequency = refresh_kind.frequency();
         }
     }
 
@@ -291,15 +288,11 @@ impl CpusWrapper {
     }
 
     pub fn get_frequencies(&mut self) {
-        if self.got_cpu_frequency {
-            return;
-        }
         let frequencies = get_frequencies(self.cpus.len());
 
         for (cpu, frequency) in self.cpus.iter_mut().zip(frequencies) {
             cpu.inner.set_frequency(frequency);
         }
-        self.got_cpu_frequency = true;
     }
 }
 


Test patch: