Advertisement
Guest User

Untitled

a guest
Dec 27th, 2016
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. Performance counter stats for './target/release/fl':
  2.  
  3. 3570,953007 task-clock (msec) # 1,000 CPUs utilized
  4. 10 context-switches # 0,003 K/sec
  5. 0 cpu-migrations # 0,000 K/sec
  6. 113 page-faults # 0,032 K/sec
  7. 7122554792 cycles # 1,995 GHz
  8. <not supported> stalled-cycles-frontend
  9. <not supported> stalled-cycles-backend
  10. 14789974128 instructions # 2,08 insns per cycle
  11. 3270834989 branches # 915,956 M/sec
  12. 98659373 branch-misses # 3,02% of all branches
  13.  
  14. 3,571524133 seconds time elapsed
  15.  
  16.  
  17. Performance counter stats for './main':
  18.  
  19. 2666,074874 task-clock (msec) # 1,001 CPUs utilized
  20. 342 context-switches # 0,128 K/sec
  21. 8 cpu-migrations # 0,003 K/sec
  22. 137 page-faults # 0,051 K/sec
  23. 5311949003 cycles # 1,992 GHz
  24. <not supported> stalled-cycles-frontend
  25. <not supported> stalled-cycles-backend
  26. 10034346466 instructions # 1,89 insns per cycle
  27. 2073760220 branches # 777,833 M/sec
  28. 52485608 branch-misses # 2,53% of all branches
  29.  
  30. 2,663269590 seconds time elapsed
  31.  
  32.  
  33.  
  34.  
  35. use std::io;
  36. use std::io::BufReader;
  37. use std::io::BufRead;
  38. use std::fs::File;
  39.  
  40. fn main() {
  41. let f = File::open("www.js").unwrap();
  42. let mut file = BufReader::new(&f);
  43. let mut buffer = String::new();
  44. let mut count = 0;
  45.  
  46. while file.read_line(&mut buffer).unwrap() != 0 {
  47. if buffer.contains("array") {
  48. count += 1;
  49. }
  50. buffer.clear();
  51. }
  52. println!("{}", count);
  53. }
  54.  
  55.  
  56.  
  57.  
  58. package main
  59.  
  60. import (
  61. "bufio"
  62. "bytes"
  63. "fmt"
  64. "io"
  65. "log"
  66. "os"
  67. )
  68.  
  69. func main() {
  70.  
  71. f, err := os.Open("www.js")
  72. count := 0
  73. bf := bufio.NewReader(f)
  74.  
  75. arr := []byte("array")
  76. for {
  77. line, _, err := bf.ReadLine()
  78.  
  79. if err == io.EOF {
  80. break
  81. }
  82.  
  83. if bytes.Contains(line, arr) {
  84. count++
  85. }
  86.  
  87. }
  88. fmt.Println(count)
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement